Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determining system uptime

Status
Not open for further replies.

brlund

Programmer
Nov 4, 2002
2
CA
Hi,
Using C++ builder 6.0, I would like to determine the length of time the system has been running since the last reboot or start. I would then display this number in a tstatic box. I do not know which function to use to determine the system uptime.

Thanks,
brlund
 
I would suggest that you look into the GetTickCount[/b[ API call.

GetTickCount determines how much time has elapsed since Windows was last started. The time is measured in milliseconds, although the actual resolution of the function's output depends on that of the system timer itself. Therefore, it may not be perfectly accurate to the millisecond. Because of the limitations of the 32-bit integer data type, the reported elapsed time wraps back to zero after about 49.7 days of continuous operation. Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Thank you CajunCenturion for your help. I know where to start now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top