Skip to content

Instantly share code, notes, and snippets.

@gpestana
Created June 25, 2014 13:51
Show Gist options
  • Save gpestana/c9a7db00a91ade82a038 to your computer and use it in GitHub Desktop.
Save gpestana/c9a7db00a91ade82a038 to your computer and use it in GitHub Desktop.
accurate timer c
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