{"action":"created","comment":{"url":"https://api.github.com/repos/sharkdp/hyperfine/pulls/comments/165827691","pull_request_review_id":93829483,"id":165827691,"diff_hunk":"@@ -45,9 +45,53 @@ fn get_cpu_times() -> CPUTimes {\n /// Read CPU execution times (dummy for now)\n #[cfg(windows)]\n fn get_cpu_times() -> CPUTimes {\n+    use winapi::um::processthreadsapi::{GetCurrentProcess, GetProcessTimes};\n+    use winapi::shared::minwindef::FILETIME;\n+\n+    // Winapi reports times as per 100 nanosecond\n+    const HUNDRED_NS_PER_MS: i64 = 10;\n+    \n+    let mut _ctime = FILETIME {\n+        dwLowDateTime: 0,\n+        dwHighDateTime: 0,\n+    };\n+    let mut _etime = FILETIME {\n+        dwLowDateTime: 0,\n+        dwHighDateTime: 0,\n+    };\n+    let mut kernel_time = FILETIME {\n+        dwLowDateTime: 0,\n+        dwHighDateTime: 0,\n+    };\n+    let mut user_time = FILETIME {\n+        dwLowDateTime: 0,\n+        dwHighDateTime: 0,\n+    };\n+\n+    let (user_usec, system_usec) = unsafe {\n+        let handle = GetCurrentProcess();","path":"src/hyperfine/timer/cputimer.rs","position":28,"original_position":28,"commit_id":"b1c2b1415f17b45f1ca7689c1e5cf0909917d78a","original_commit_id":"b1c2b1415f17b45f1ca7689c1e5cf0909917d78a","user":{"login":"stevepentland","id":8147610,"avatar_url":"https://avatars2.githubusercontent.com/u/8147610?v=4","gravatar_id":"","url":"https://api.github.com/users/stevepentland","html_url":"https://github.com/stevepentland","followers_url":"https://api.github.com/users/stevepentland/followers","following_url":"https://api.github.com/users/stevepentland/following{/other_user}","gists_url":"https://api.github.com/users/stevepentland/gists{/gist_id}","starred_url":"https://api.github.com/users/stevepentland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevepentland/subscriptions","organizations_url":"https://api.github.com/users/stevepentland/orgs","repos_url":"https://api.github.com/users/stevepentland/repos","events_url":"https://api.github.com/users/stevepentland/events{/privacy}","received_events_url":"https://api.github.com/users/stevepentland/received_events","type":"User","site_admin":false},"body":"This is a good question, that I honestly don't know 100% for sure about. My initial hope is that as each command we spawn is treated as a child process of our current handle and that we window the requests, we can piggyback and obtain the desired information. However, this may not actually be the case.\r\n\r\nOtherwise we may have to use [CreateProcess](https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx) from the winapi crate and possible use the procedure outlined [here](https://msdn.microsoft.com/en-us/library/windows/desktop/ms682499(v=vs.85).aspx) to obtain the proper information with a handle.","created_at":"2018-02-03T22:45:16Z","updated_at":"2018-02-03T22:45:16Z","html_url":"https://github.com/sharkdp/hyperfine/pull/34#discussion_r165827691","pull_request_url":"https://api.github.com/repos/sharkdp/hyperfine/pulls/34","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/sharkdp/hyperfine/pulls/comments/165827691"},"html":{"href":"https://github.com/sharkdp/hyperfine/pull/34#discussion_r165827691"},"pull_request":{"href":"https://api.github.com/repos/sharkdp/hyperfine/pulls/34"}},"in_reply_to_id":165826156},"pull_request":{"url":"https://api.github.com/repos/sharkdp/hyperfine/pulls/34","id":166981583,"html_url":"https://github.com/sharkdp/hyperfine/pull/34","diff_url":"https://github.com/sharkdp/hyperfine/pull/34.diff","patch_url":"https://github.com/sharkdp/hyperfine/pull/34.patch","issue_url":"https://api.github.com/repos/sharkdp/hyperfine/issues/34","number":34,"state":"open","locked":false,"title":"Windows timing","user":{"login":"stevepentland","id":8147610,"avatar_url":"https://avatars2.githubusercontent.com/u/8147610?v=4","gravatar_id":"","url":"https://api.github.com/users/stevepentland","html_url":"https://github.com/stevepentland","followers_url":"https://api.github.com/users/stevepentland/followers","following_url":"https://api.github.com/users/stevepentland/following{/other_user}","gists_url":"https://api.github.com/users/stevepentland/gists{/gist_id}","starred_url":"https://api.github.com/users/stevepentland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevepentland/subscriptions","organizations_url":"https://api.github.com/users/stevepentland/orgs","repos_url":"https://api.github.com/users/stevepentland/repos","events_url":"https://api.github.com/users/stevepentland/events{/privacy}","received_events_url":"https://api.github.com/users/stevepentland/received_events","type":"User","site_admin":false},"body":"In response to #33 this adds timing for Windows. Using `GetProcessTimes`, the current kernel and user times are measured.\r\n\r\nThis results in values reported that seem reasonable for the commands run. ","created_at":"2018-02-03T21:30:15Z","updated_at":"2018-02-03T22:45:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c7a8af519316fc6310e563a26c28eb481fe4f186","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/sharkdp/hyperfine/pulls/34/commits","review_comments_url":"https://api.github.com/repos/sharkdp/hyperfine/pulls/34/comments","review_comment_url":"https://api.github.com/repos/sharkdp/hyperfine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sharkdp/hyperfine/issues/34/comments","statuses_url":"https://api.github.com/repos/sharkdp/hyperfine/statuses/b1c2b1415f17b45f1ca7689c1e5cf0909917d78a","head":{"label":"stevepentland:windows-timing","ref":"windows-timing","sha":"b1c2b1415f17b45f1ca7689c1e5cf0909917d78a","user":{"login":"stevepentland","id":8147610,"avatar_url":"https://avatars2.githubusercontent.com/u/8147610?v=4","gravatar_id":"","url":"https://api.github.com/users/stevepentland","html_url":"https://github.com/stevepentland","followers_url":"https://api.github.com/users/stevepentland/followers","following_url":"https://api.github.com/users/stevepentland/following{/other_user}","gists_url":"https://api.github.com/users/stevepentland/gists{/gist_id}","starred_url":"https://api.github.com/users/stevepentland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevepentland/subscriptions","organizations_url":"https://api.github.com/users/stevepentland/orgs","repos_url":"https://api.github.com/users/stevepentland/repos","events_url":"https://api.github.com/users/stevepentland/events{/privacy}","received_events_url":"https://api.github.com/users/stevepentland/received_events","type":"User","site_admin":false},"repo":{"id":118486324,"name":"hyperfine","full_name":"stevepentland/hyperfine","owner":{"login":"stevepentland","id":8147610,"avatar_url":"https://avatars2.githubusercontent.com/u/8147610?v=4","gravatar_id":"","url":"https://api.github.com/users/stevepentland","html_url":"https://github.com/stevepentland","followers_url":"https://api.github.com/users/stevepentland/followers","following_url":"https://api.github.com/users/stevepentland/following{/other_user}","gists_url":"https://api.github.com/users/stevepentland/gists{/gist_id}","starred_url":"https://api.github.com/users/stevepentland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevepentland/subscriptions","organizations_url":"https://api.github.com/users/stevepentland/orgs","repos_url":"https://api.github.com/users/stevepentland/repos","events_url":"https://api.github.com/users/stevepentland/events{/privacy}","received_events_url":"https://api.github.com/users/stevepentland/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stevepentland/hyperfine","description":"A command-line benchmarking tool","fork":true,"url":"https://api.github.com/repos/stevepentland/hyperfine","forks_url":"https://api.github.com/repos/stevepentland/hyperfine/forks","keys_url":"https://api.github.com/repos/stevepentland/hyperfine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stevepentland/hyperfine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stevepentland/hyperfine/teams","hooks_url":"https://api.github.com/repos/stevepentland/hyperfine/hooks","issue_events_url":"https://api.github.com/repos/stevepentland/hyperfine/issues/events{/number}","events_url":"https://api.github.com/repos/stevepentland/hyperfine/events","assignees_url":"https://api.github.com/repos/stevepentland/hyperfine/assignees{/user}","branches_url":"https://api.github.com/repos/stevepentland/hyperfine/branches{/branch}","tags_url":"https://api.github.com/repos/stevepentland/hyperfine/tags","blobs_url":"https://api.github.com/repos/stevepentland/hyperfine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stevepentland/hyperfine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stevepentland/hyperfine/git/refs{/sha}","trees_url":"https://api.github.com/repos/stevepentland/hyperfine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stevepentland/hyperfine/statuses/{sha}","languages_url":"https://api.github.com/repos/stevepentland/hyperfine/languages","stargazers_url":"https://api.github.com/repos/stevepentland/hyperfine/stargazers","contributors_url":"https://api.github.com/repos/stevepentland/hyperfine/contributors","subscribers_url":"https://api.github.com/repos/stevepentland/hyperfine/subscribers","subscription_url":"https://api.github.com/repos/stevepentland/hyperfine/subscription","commits_url":"https://api.github.com/repos/stevepentland/hyperfine/commits{/sha}","git_commits_url":"https://api.github.com/repos/stevepentland/hyperfine/git/commits{/sha}","comments_url":"https://api.github.com/repos/stevepentland/hyperfine/comments{/number}","issue_comment_url":"https://api.github.com/repos/stevepentland/hyperfine/issues/comments{/number}","contents_url":"https://api.github.com/repos/stevepentland/hyperfine/contents/{+path}","compare_url":"https://api.github.com/repos/stevepentland/hyperfine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stevepentland/hyperfine/merges","archive_url":"https://api.github.com/repos/stevepentland/hyperfine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stevepentland/hyperfine/downloads","issues_url":"https://api.github.com/repos/stevepentland/hyperfine/issues{/number}","pulls_url":"https://api.github.com/repos/stevepentland/hyperfine/pulls{/number}","milestones_url":"https://api.github.com/repos/stevepentland/hyperfine/milestones{/number}","notifications_url":"https://api.github.com/repos/stevepentland/hyperfine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stevepentland/hyperfine/labels{/name}","releases_url":"https://api.github.com/repos/stevepentland/hyperfine/releases{/id}","deployments_url":"https://api.github.com/repos/stevepentland/hyperfine/deployments","created_at":"2018-01-22T16:51:43Z","updated_at":"2018-01-22T16:51:44Z","pushed_at":"2018-02-03T21:27:42Z","git_url":"git://github.com/stevepentland/hyperfine.git","ssh_url":"git@github.com:stevepentland/hyperfine.git","clone_url":"https://github.com/stevepentland/hyperfine.git","svn_url":"https://github.com/stevepentland/hyperfine","homepage":null,"size":85,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sharkdp:master","ref":"master","sha":"00295f3f7fe6e9c3bc96cb6e4e018755338c1fcf","user":{"login":"sharkdp","id":4209276,"avatar_url":"https://avatars2.githubusercontent.com/u/4209276?v=4","gravatar_id":"","url":"https://api.github.com/users/sharkdp","html_url":"https://github.com/sharkdp","followers_url":"https://api.github.com/users/sharkdp/followers","following_url":"https://api.github.com/users/sharkdp/following{/other_user}","gists_url":"https://api.github.com/users/sharkdp/gists{/gist_id}","starred_url":"https://api.github.com/users/sharkdp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharkdp/subscriptions","organizations_url":"https://api.github.com/users/sharkdp/orgs","repos_url":"https://api.github.com/users/sharkdp/repos","events_url":"https://api.github.com/users/sharkdp/events{/privacy}","received_events_url":"https://api.github.com/users/sharkdp/received_events","type":"User","site_admin":false},"repo":{"id":117356231,"name":"hyperfine","full_name":"sharkdp/hyperfine","owner":{"login":"sharkdp","id":4209276,"avatar_url":"https://avatars2.githubusercontent.com/u/4209276?v=4","gravatar_id":"","url":"https://api.github.com/users/sharkdp","html_url":"https://github.com/sharkdp","followers_url":"https://api.github.com/users/sharkdp/followers","following_url":"https://api.github.com/users/sharkdp/following{/other_user}","gists_url":"https://api.github.com/users/sharkdp/gists{/gist_id}","starred_url":"https://api.github.com/users/sharkdp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharkdp/subscriptions","organizations_url":"https://api.github.com/users/sharkdp/orgs","repos_url":"https://api.github.com/users/sharkdp/repos","events_url":"https://api.github.com/users/sharkdp/events{/privacy}","received_events_url":"https://api.github.com/users/sharkdp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sharkdp/hyperfine","description":"A command-line benchmarking tool","fork":false,"url":"https://api.github.com/repos/sharkdp/hyperfine","forks_url":"https://api.github.com/repos/sharkdp/hyperfine/forks","keys_url":"https://api.github.com/repos/sharkdp/hyperfine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sharkdp/hyperfine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sharkdp/hyperfine/teams","hooks_url":"https://api.github.com/repos/sharkdp/hyperfine/hooks","issue_events_url":"https://api.github.com/repos/sharkdp/hyperfine/issues/events{/number}","events_url":"https://api.github.com/repos/sharkdp/hyperfine/events","assignees_url":"https://api.github.com/repos/sharkdp/hyperfine/assignees{/user}","branches_url":"https://api.github.com/repos/sharkdp/hyperfine/branches{/branch}","tags_url":"https://api.github.com/repos/sharkdp/hyperfine/tags","blobs_url":"https://api.github.com/repos/sharkdp/hyperfine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sharkdp/hyperfine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sharkdp/hyperfine/git/refs{/sha}","trees_url":"https://api.github.com/repos/sharkdp/hyperfine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sharkdp/hyperfine/statuses/{sha}","languages_url":"https://api.github.com/repos/sharkdp/hyperfine/languages","stargazers_url":"https://api.github.com/repos/sharkdp/hyperfine/stargazers","contributors_url":"https://api.github.com/repos/sharkdp/hyperfine/contributors","subscribers_url":"https://api.github.com/repos/sharkdp/hyperfine/subscribers","subscription_url":"https://api.github.com/repos/sharkdp/hyperfine/subscription","commits_url":"https://api.github.com/repos/sharkdp/hyperfine/commits{/sha}","git_commits_url":"https://api.github.com/repos/sharkdp/hyperfine/git/commits{/sha}","comments_url":"https://api.github.com/repos/sharkdp/hyperfine/comments{/number}","issue_comment_url":"https://api.github.com/repos/sharkdp/hyperfine/issues/comments{/number}","contents_url":"https://api.github.com/repos/sharkdp/hyperfine/contents/{+path}","compare_url":"https://api.github.com/repos/sharkdp/hyperfine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sharkdp/hyperfine/merges","archive_url":"https://api.github.com/repos/sharkdp/hyperfine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sharkdp/hyperfine/downloads","issues_url":"https://api.github.com/repos/sharkdp/hyperfine/issues{/number}","pulls_url":"https://api.github.com/repos/sharkdp/hyperfine/pulls{/number}","milestones_url":"https://api.github.com/repos/sharkdp/hyperfine/milestones{/number}","notifications_url":"https://api.github.com/repos/sharkdp/hyperfine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sharkdp/hyperfine/labels{/name}","releases_url":"https://api.github.com/repos/sharkdp/hyperfine/releases{/id}","deployments_url":"https://api.github.com/repos/sharkdp/hyperfine/deployments","created_at":"2018-01-13T15:49:54Z","updated_at":"2018-02-03T19:22:26Z","pushed_at":"2018-02-03T21:30:16Z","git_url":"git://github.com/sharkdp/hyperfine.git","ssh_url":"git@github.com:sharkdp/hyperfine.git","clone_url":"https://github.com/sharkdp/hyperfine.git","svn_url":"https://github.com/sharkdp/hyperfine","homepage":null,"size":82,"stargazers_count":1142,"watchers_count":1142,"language":"Rust","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":19,"mirror_url":null,"archived":false,"open_issues_count":7,"license":null,"forks":19,"open_issues":7,"watchers":1142,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sharkdp/hyperfine/pulls/34"},"html":{"href":"https://github.com/sharkdp/hyperfine/pull/34"},"issue":{"href":"https://api.github.com/repos/sharkdp/hyperfine/issues/34"},"comments":{"href":"https://api.github.com/repos/sharkdp/hyperfine/issues/34/comments"},"review_comments":{"href":"https://api.github.com/repos/sharkdp/hyperfine/pulls/34/comments"},"review_comment":{"href":"https://api.github.com/repos/sharkdp/hyperfine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sharkdp/hyperfine/pulls/34/commits"},"statuses":{"href":"https://api.github.com/repos/sharkdp/hyperfine/statuses/b1c2b1415f17b45f1ca7689c1e5cf0909917d78a"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"stevepentland"}}