Results 1 to 2 of 2
Hi:
I would like to monitor some time differences, in seconds (or miliseconds), from a linux program. I don't want this to be vulnerable to someone changing the system clock.
...
- 06-04-2008 #1Just Joined!
- Join Date
- Oct 2006
- Posts
- 22
Monitor time differences from userspace program
Hi:
I would like to monitor some time differences, in seconds (or miliseconds), from a linux program. I don't want this to be vulnerable to someone changing the system clock.
What are my options?
I realize that cat /proc/uptime and the uptime linux function provide a time in seconds(?). Is there an elegant way for a user space program to also access this information in binary form?
Or is there a different timer that I can use from userspace? Jiffies are only available to the kernel?
Thanks,
--B
- 06-04-2008 #2
The man page for the times() function (notice the "s") shows that the function has as its return value (not the struct) the number of clock ticks since the system was booted. This is independent of the time of day.
Hope this helps.--
Bill
Old age and treachery will overcome youth and skill.


Reply With Quote