You should be able to call the GetTickCount API function through the
P/Invoke layer. This will give you the number of ticks that have elapsed
since the system was turned on. You can then get the system resolution
through a call to the GetSystemTimeAdjustment function as well.
However, in the documentation for the GetTickCount function, it states:
To obtain the time elapsed since the computer was started, retrieve the
System Up Time counter in the performance data in the registry key
HKEY_PERFORMANCE_DATA. The value returned is an 8-byte value. For more
information, see Performance Monitoring.
So you should use the registry classes (or the performance counter
classes) to access this information.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.