Stuart McLachlan
stuart at lexacorp.com.pg
Mon Feb 14 07:54:35 CST 2005
On 14 Feb 2005 at 14:23, Gustav Brock wrote: > Hi all > > Has anyone used this? > It is a classic in the callback function example but I don't recall any > reference to it. > > It seems to return seconds from midnight as well as a fraction of a > second with a resolution of about 1/60 second. Thus it could be used > where you need a resolution of less than one second. > I've been using the Timer function in various flavours of Basic for may years. TheTimer finctions (and the .Net DateTime.Now) use the getTickCount API function. In W9X, the default resolution is approx 50ms (actually 55 ms or 18.2 times per second), in NT/2K/XP it's approx 10 ms. It also has a very low priority in the task queue so can be postponed/cancelled. There are two more accurate timers available. timeGetTime ( Environment.TickCount in.Net) which is good for 1/1000 sec but has a fairly high overhead and QueryPerformanceCounter/PerformanceFrequency which is very accurate for *short* times. -- Stuart