Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Steve Tooke <steve@bl...> - 2003-12-04 21:43:47
|
Hi, I've implemented NdisGetSystemUpTime. This returns the uptime in milliseconds. You'll need to #inlcude <linux/param.h> for HZ, which gives the number of clock ticks generated per second, and #include <linux/sched.h> for jiffies, which is the system uptime in clock ticks. /* * returns number of milliseconds since system was restarted */ STDCALL void NdisGetSystemUpTime (unsigned long *time) { #define TICKS_PER_MS (HZ/1000) unsigned long uptime = jiffies/TICKS_PER_MS; /* uptime in ms */ *time = uptime; } Cheers, Steve |