QPF and QPC are kernel calls which provide you with a high performance timer (usually ~1 microsecond resolution). To solve your prob to determine system uptime you would
1. read QueryPeformancePCounter once.
2. read QueryPerformanceFrequency
3. Diviide the QPC value by QPF
Result is in seconds. Note QPC and QPF are 64 bit values. Rollover shouldn't occur in your lifetime and those calls are compatible all the way back to Win32S.
1. read QueryPeformancePCounter once.
2. read QueryPerformanceFrequency
3. Diviide the QPC value by QPF
Result is in seconds. Note QPC and QPF are 64 bit values. Rollover shouldn't occur in your lifetime and those calls are compatible all the way back to Win32S.
oh thanks for you good describing it works now but how do i idiv the two 64 values?
Check out http://www.masmforum.com/simple/index.php?topic=770.0 from MASM forum.
The attached asm source there should get you started with slight modifications.
The attached asm source there should get you started with slight modifications.
lilljocke,
The basic assumptions appear to be inappropriate to the task you have in mind. If it is an uptime counter you hardly need high resolution so instead of using a function that is performing time checking at high intervals, why not use the system time and have a look at it one a minute. You have to do some arithmetic from the first sample you take but you don't have to rely on a single OS based counter if you use the time rater than the system tick count.
The basic assumptions appear to be inappropriate to the task you have in mind. If it is an uptime counter you hardly need high resolution so instead of using a function that is performing time checking at high intervals, why not use the system time and have a look at it one a minute. You have to do some arithmetic from the first sample you take but you don't have to rely on a single OS based counter if you use the time rater than the system tick count.
I have tryed to use GetLocalTime and GetSytemTime and compare them but it is hard i think. Do you know how to do it please show me.
I have tryed to use GetLocalTime and GetSytemTime and compare...
That won't do what you want to do. That will give you the offset from UTC (GMT) for your timezone.