{"action":"created","comment":{"url":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/comments/63323399","id":63323399,"diff_hunk":"@@ -27,13 +27,20 @@ ProfilerTest: class extends Fixture {\n \t\t\texpect(content empty(), is false)\n \t\t\t(profiler, content, file) free()\n \t\t})\n+\t\tthis add(\"benchmark\", This _testBenchmark)\n \t\tthis add(\"cleanup\", func {\n \t\t\tprofiler := Profiler new(\"for cleanup\")\n \t\t\tprofiler start() . stop()\n \t\t\tprofilerToFree := Profiler new(\"to free\")\n \t\t\tprofilerToFree free()\n \t\t})\n \t}\n+\t_testBenchmark: static func {\n+\t\tslowTask := func { Time sleepMilli(1) }\n+\t\tfastTask := func\n+\t\texpect(Profiler benchmark(slowTask, 5), is greater than(Profiler benchmark(fastTask, 5)))\n+\t\t(slowTask as Closure, fastTask as Closure) free()\n+\t}","path":"test/base/ProfilerTest.ooc","position":17,"original_position":17,"commit_id":"96da54080084a74f36bad7360f60bae41bb73a24","original_commit_id":"96da54080084a74f36bad7360f60bae41bb73a24","user":{"login":"marcusnaslund","id":14308896,"avatar_url":"https://avatars.githubusercontent.com/u/14308896?v=3","gravatar_id":"","url":"https://api.github.com/users/marcusnaslund","html_url":"https://github.com/marcusnaslund","followers_url":"https://api.github.com/users/marcusnaslund/followers","following_url":"https://api.github.com/users/marcusnaslund/following{/other_user}","gists_url":"https://api.github.com/users/marcusnaslund/gists{/gist_id}","starred_url":"https://api.github.com/users/marcusnaslund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcusnaslund/subscriptions","organizations_url":"https://api.github.com/users/marcusnaslund/orgs","repos_url":"https://api.github.com/users/marcusnaslund/repos","events_url":"https://api.github.com/users/marcusnaslund/events{/privacy}","received_events_url":"https://api.github.com/users/marcusnaslund/received_events","type":"User","site_admin":false},"body":"Does it not work if the code is part of the `add` call, as for the other tests?","created_at":"2016-05-16T08:35:24Z","updated_at":"2016-05-16T08:35:24Z","html_url":"https://github.com/magic-lang/ooc-kean/pull/1716#discussion_r63323399","pull_request_url":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1716","_links":{"self":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/comments/63323399"},"html":{"href":"https://github.com/magic-lang/ooc-kean/pull/1716#discussion_r63323399"},"pull_request":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1716"}}},"pull_request":{"url":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1716","id":70117856,"html_url":"https://github.com/magic-lang/ooc-kean/pull/1716","diff_url":"https://github.com/magic-lang/ooc-kean/pull/1716.diff","patch_url":"https://github.com/magic-lang/ooc-kean/pull/1716.patch","issue_url":"https://api.github.com/repos/magic-lang/ooc-kean/issues/1716","number":1716,"state":"open","locked":false,"title":"simple benchmark() function for Profiler","user":{"login":"sebastianbaginski","id":13517893,"avatar_url":"https://avatars.githubusercontent.com/u/13517893?v=3","gravatar_id":"","url":"https://api.github.com/users/sebastianbaginski","html_url":"https://github.com/sebastianbaginski","followers_url":"https://api.github.com/users/sebastianbaginski/followers","following_url":"https://api.github.com/users/sebastianbaginski/following{/other_user}","gists_url":"https://api.github.com/users/sebastianbaginski/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastianbaginski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastianbaginski/subscriptions","organizations_url":"https://api.github.com/users/sebastianbaginski/orgs","repos_url":"https://api.github.com/users/sebastianbaginski/repos","events_url":"https://api.github.com/users/sebastianbaginski/events{/privacy}","received_events_url":"https://api.github.com/users/sebastianbaginski/received_events","type":"User","site_admin":false},"body":"Just a simple idea for basic performance measurements. Use like:\r\n```ooc\r\nuse base\r\ninclude sched\r\n\r\n\"average : %f ms\" printfln(Profiler benchmark(func {\r\n\tTime sleepMilli(300)\r\n}))\r\n```\r\n\r\n> average : 300.116500 ms\r\n\r\n@marcusnaslund what do you think about this ?","created_at":"2016-05-15T10:36:17Z","updated_at":"2016-05-16T08:35:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"762da9f13cc2aded053b870e54c203b693894300","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1716/commits","review_comments_url":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1716/comments","review_comment_url":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/comments{/number}","comments_url":"https://api.github.com/repos/magic-lang/ooc-kean/issues/1716/comments","statuses_url":"https://api.github.com/repos/magic-lang/ooc-kean/statuses/96da54080084a74f36bad7360f60bae41bb73a24","head":{"label":"sebastianbaginski:fixturebenchmark","ref":"fixturebenchmark","sha":"96da54080084a74f36bad7360f60bae41bb73a24","user":{"login":"sebastianbaginski","id":13517893,"avatar_url":"https://avatars.githubusercontent.com/u/13517893?v=3","gravatar_id":"","url":"https://api.github.com/users/sebastianbaginski","html_url":"https://github.com/sebastianbaginski","followers_url":"https://api.github.com/users/sebastianbaginski/followers","following_url":"https://api.github.com/users/sebastianbaginski/following{/other_user}","gists_url":"https://api.github.com/users/sebastianbaginski/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastianbaginski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastianbaginski/subscriptions","organizations_url":"https://api.github.com/users/sebastianbaginski/orgs","repos_url":"https://api.github.com/users/sebastianbaginski/repos","events_url":"https://api.github.com/users/sebastianbaginski/events{/privacy}","received_events_url":"https://api.github.com/users/sebastianbaginski/received_events","type":"User","site_admin":false},"repo":{"id":39762712,"name":"ooc-kean","full_name":"sebastianbaginski/ooc-kean","owner":{"login":"sebastianbaginski","id":13517893,"avatar_url":"https://avatars.githubusercontent.com/u/13517893?v=3","gravatar_id":"","url":"https://api.github.com/users/sebastianbaginski","html_url":"https://github.com/sebastianbaginski","followers_url":"https://api.github.com/users/sebastianbaginski/followers","following_url":"https://api.github.com/users/sebastianbaginski/following{/other_user}","gists_url":"https://api.github.com/users/sebastianbaginski/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastianbaginski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastianbaginski/subscriptions","organizations_url":"https://api.github.com/users/sebastianbaginski/orgs","repos_url":"https://api.github.com/users/sebastianbaginski/repos","events_url":"https://api.github.com/users/sebastianbaginski/events{/privacy}","received_events_url":"https://api.github.com/users/sebastianbaginski/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sebastianbaginski/ooc-kean","description":"ooc port of parts of Kean.","fork":true,"url":"https://api.github.com/repos/sebastianbaginski/ooc-kean","forks_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/forks","keys_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/teams","hooks_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/hooks","issue_events_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/issues/events{/number}","events_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/events","assignees_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/assignees{/user}","branches_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/branches{/branch}","tags_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/tags","blobs_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/git/refs{/sha}","trees_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/statuses/{sha}","languages_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/languages","stargazers_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/stargazers","contributors_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/contributors","subscribers_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/subscribers","subscription_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/subscription","commits_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/commits{/sha}","git_commits_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/git/commits{/sha}","comments_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/comments{/number}","issue_comment_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/issues/comments{/number}","contents_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/contents/{+path}","compare_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/merges","archive_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/downloads","issues_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/issues{/number}","pulls_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/pulls{/number}","milestones_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/milestones{/number}","notifications_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/labels{/name}","releases_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/releases{/id}","deployments_url":"https://api.github.com/repos/sebastianbaginski/ooc-kean/deployments","created_at":"2015-07-27T08:08:08Z","updated_at":"2016-01-11T17:58:42Z","pushed_at":"2016-05-15T17:30:17Z","git_url":"git://github.com/sebastianbaginski/ooc-kean.git","ssh_url":"git@github.com:sebastianbaginski/ooc-kean.git","clone_url":"https://github.com/sebastianbaginski/ooc-kean.git","svn_url":"https://github.com/sebastianbaginski/ooc-kean","homepage":"","size":32712,"stargazers_count":0,"watchers_count":0,"language":"ooc","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"magic-lang:develop","ref":"develop","sha":"6823437250f58057b24908520c988c6e7828a4c4","user":{"login":"magic-lang","id":16756691,"avatar_url":"https://avatars.githubusercontent.com/u/16756691?v=3","gravatar_id":"","url":"https://api.github.com/users/magic-lang","html_url":"https://github.com/magic-lang","followers_url":"https://api.github.com/users/magic-lang/followers","following_url":"https://api.github.com/users/magic-lang/following{/other_user}","gists_url":"https://api.github.com/users/magic-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/magic-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magic-lang/subscriptions","organizations_url":"https://api.github.com/users/magic-lang/orgs","repos_url":"https://api.github.com/users/magic-lang/repos","events_url":"https://api.github.com/users/magic-lang/events{/privacy}","received_events_url":"https://api.github.com/users/magic-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":25256330,"name":"ooc-kean","full_name":"magic-lang/ooc-kean","owner":{"login":"magic-lang","id":16756691,"avatar_url":"https://avatars.githubusercontent.com/u/16756691?v=3","gravatar_id":"","url":"https://api.github.com/users/magic-lang","html_url":"https://github.com/magic-lang","followers_url":"https://api.github.com/users/magic-lang/followers","following_url":"https://api.github.com/users/magic-lang/following{/other_user}","gists_url":"https://api.github.com/users/magic-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/magic-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magic-lang/subscriptions","organizations_url":"https://api.github.com/users/magic-lang/orgs","repos_url":"https://api.github.com/users/magic-lang/repos","events_url":"https://api.github.com/users/magic-lang/events{/privacy}","received_events_url":"https://api.github.com/users/magic-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/magic-lang/ooc-kean","description":"ooc port of parts of Kean.","fork":false,"url":"https://api.github.com/repos/magic-lang/ooc-kean","forks_url":"https://api.github.com/repos/magic-lang/ooc-kean/forks","keys_url":"https://api.github.com/repos/magic-lang/ooc-kean/keys{/key_id}","collaborators_url":"https://api.github.com/repos/magic-lang/ooc-kean/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/magic-lang/ooc-kean/teams","hooks_url":"https://api.github.com/repos/magic-lang/ooc-kean/hooks","issue_events_url":"https://api.github.com/repos/magic-lang/ooc-kean/issues/events{/number}","events_url":"https://api.github.com/repos/magic-lang/ooc-kean/events","assignees_url":"https://api.github.com/repos/magic-lang/ooc-kean/assignees{/user}","branches_url":"https://api.github.com/repos/magic-lang/ooc-kean/branches{/branch}","tags_url":"https://api.github.com/repos/magic-lang/ooc-kean/tags","blobs_url":"https://api.github.com/repos/magic-lang/ooc-kean/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/magic-lang/ooc-kean/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/magic-lang/ooc-kean/git/refs{/sha}","trees_url":"https://api.github.com/repos/magic-lang/ooc-kean/git/trees{/sha}","statuses_url":"https://api.github.com/repos/magic-lang/ooc-kean/statuses/{sha}","languages_url":"https://api.github.com/repos/magic-lang/ooc-kean/languages","stargazers_url":"https://api.github.com/repos/magic-lang/ooc-kean/stargazers","contributors_url":"https://api.github.com/repos/magic-lang/ooc-kean/contributors","subscribers_url":"https://api.github.com/repos/magic-lang/ooc-kean/subscribers","subscription_url":"https://api.github.com/repos/magic-lang/ooc-kean/subscription","commits_url":"https://api.github.com/repos/magic-lang/ooc-kean/commits{/sha}","git_commits_url":"https://api.github.com/repos/magic-lang/ooc-kean/git/commits{/sha}","comments_url":"https://api.github.com/repos/magic-lang/ooc-kean/comments{/number}","issue_comment_url":"https://api.github.com/repos/magic-lang/ooc-kean/issues/comments{/number}","contents_url":"https://api.github.com/repos/magic-lang/ooc-kean/contents/{+path}","compare_url":"https://api.github.com/repos/magic-lang/ooc-kean/compare/{base}...{head}","merges_url":"https://api.github.com/repos/magic-lang/ooc-kean/merges","archive_url":"https://api.github.com/repos/magic-lang/ooc-kean/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/magic-lang/ooc-kean/downloads","issues_url":"https://api.github.com/repos/magic-lang/ooc-kean/issues{/number}","pulls_url":"https://api.github.com/repos/magic-lang/ooc-kean/pulls{/number}","milestones_url":"https://api.github.com/repos/magic-lang/ooc-kean/milestones{/number}","notifications_url":"https://api.github.com/repos/magic-lang/ooc-kean/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/magic-lang/ooc-kean/labels{/name}","releases_url":"https://api.github.com/repos/magic-lang/ooc-kean/releases{/id}","deployments_url":"https://api.github.com/repos/magic-lang/ooc-kean/deployments","created_at":"2014-10-15T13:42:17Z","updated_at":"2016-03-02T07:55:35Z","pushed_at":"2016-05-16T08:25:30Z","git_url":"git://github.com/magic-lang/ooc-kean.git","ssh_url":"git@github.com:magic-lang/ooc-kean.git","clone_url":"https://github.com/magic-lang/ooc-kean.git","svn_url":"https://github.com/magic-lang/ooc-kean","homepage":"","size":35242,"stargazers_count":4,"watchers_count":4,"language":"ooc","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":23,"mirror_url":null,"open_issues_count":25,"forks":23,"open_issues":25,"watchers":4,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1716"},"html":{"href":"https://github.com/magic-lang/ooc-kean/pull/1716"},"issue":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/issues/1716"},"comments":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/issues/1716/comments"},"review_comments":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1716/comments"},"review_comment":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/pulls/1716/commits"},"statuses":{"href":"https://api.github.com/repos/magic-lang/ooc-kean/statuses/96da54080084a74f36bad7360f60bae41bb73a24"}}}}