Link to home
Start Free TrialLog in
Avatar of peak_chen
peak_chen

asked on

hardware clock

How can I get the hardwarr clock in my c++ program beneath Solaris 2.5.1/2.6? Is there any API? What is the difference between clock_settime(), gettimeofday() and time()? How precicious are them? I want to get to it because I would take it as the time base in my system.Thank you!
Avatar of jlevie
jlevie

Why would you want to get to the hardware clock?
Avatar of peak_chen

ASKER

Edited text of question.
I guess I didn't make my query very clear. Why the hardware clock as opposed to gettimeofday(). If the sytem is set up to time sync via NTP (Network Time Protocol), I believe that the system call is usually more accurate as the hardware clock isn't necessarily updated as often. And I'd have to check to be certain, but I think the hardware clock only has a resolution of 1 sec. The system clock does a bit better as it counts clock ticks.
ASKER CERTIFIED SOLUTION
Avatar of chris_calabrese
chris_calabrese

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial