Created
June 25, 2014 13:51
-
-
Save gpestana/c9a7db00a91ade82a038 to your computer and use it in GitHub Desktop.
accurate timer c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getTime() implemented with clock_gettime(), using CLOCK_REALTIME (http://linux.die.net/man/3/clock_gettime) | |
not 100% accurate for beginning of cmsRun process, but since there are so many samplings, I think that's not problematic | |
start_time = getTime() | |
while(cmsRun_is_alive()) | |
if(diff_bigger(start_time, now = getTime(), 1ms)) | |
start_time = now | |
measure_rapl() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment