w32 GetTickCount equivalent on linux
Hi, I'm having a slight problem with uptime...
I'm running two servers, one running Slackware Linux 9 and the other running Windows 2000 server. During some maintenance both servers were shutdown. When power was back I started up the two machines at roughly the same time.
I have a couple of php scripts on each machine which report the uptime. The Windows uptime is a result of calling GetTickCount() from the Windows API. The Linux uptime is a result of parsing /proc/uptime.
Initially, after both machines had booted, the difference in uptimes between the two machines was around 6 seconds. Somehow this difference has slowly been drifting. Now after 3 days(ish) the difference is now about 23 seconds. Obviously there is something wrong here and I'm going to attempt to find out what it is.
Anyway, back to the main question. Is there a function call I can make in c under Linux which is the equivalent of the Windows GetTickCount() function? I've read that /proc/uptime sometimes reports the wrong uptime and so I'd like to check if it is the cause of the problem.
Thanks in advance.
|