April 30, 2024, 05:51:02 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Time Calculations

Started by J B Wood (Zumwalt), September 02, 2006, 05:50:01 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

J B Wood (Zumwalt)

What is the measurment of time?
timegettime()

I realize this is returning an integer, but is this miliseconds?

Ionic Wind Support Team

From MSDN:

Quote
timeGetTime
The timeGetTime function retrieves the system time, in milliseconds. The system time is the time elapsed since Windows was started.

DWORD timeGetTime(VOID);

Parameters
This function does not take parameters.

Return Values
Returns the system time, in milliseconds.

Remarks
The only difference between this function and the timeGetSystemTime function is that timeGetSystemTime uses the MMTIME structure to return the system time. The timeGetTime function has less overhead than timeGetSystemTime.

Note that the value returned by the timeGetTime function is a DWORD value. The return value wraps around to 0 every 2^32 milliseconds, which is about 49.71 days.This can cause problems in code that directly uses the timeGetTime return value in computations, particularly where the value is used to control code execution. You should always use the difference between two timeGetTime return values in computations.

Windows NT: The default precision of the timeGetTime function can be five milliseconds or more, depending on the machine. You can use the timeBeginPeriod and timeEndPeriod functions to increase the precision of timeGetTime. If you do so, the minimum difference between successive values returned by timeGetTime can be as large as the minimum period value set using timeBeginPeriod and timeEndPeriod. Use the QueryPerformanceCounter and QueryPerformanceFrequency functions to measure short time intervals at a high resolution,

Windows 95: The default precision of the timeGetTime function is 1 millisecond. In other words, the timeGetTime function can return successive values that differ by just 1 millisecond. This is true no matter what calls have been made to the timeBeginPeriod and timeEndPeriod functions.

QuickInfo
  Windows NT: Use version 3.1 and later.
  Windows: Use Windows 95 and later.
  Header: Declared in mmsystem.h.
  Import Library: Link with winmm.lib.

See Also
Multimedia Timers Overview, Multimedia Timer Functions, timeGetSystemTime, MMTIME, timeGetTime, timeBeginPeriod, timeEndPeriod, QueryPerformanceCounter, QueryPerformanceFrequency
Ionic Wind Support Team