Description

Returns the number of seconds between midnight and the system time, as of the time the DOSTIME subroutine was called. A fractional second is also returned if the number of seconds is not an exact integer, but its reliability is dependent on the speed of the system timer.

Syntax

DOSTIME (number_of_seconds)

Parameters

The DOSTIME subroutine has the following parameter.

ParameterDescription
number_of_secondsNumber of seconds between midnight and the time DOSTIME was called, according to the system timer.

Caution: Do not rely on the accuracy of the fractional second because of the speed of the system timer. According to Microsoft's documentation the timer runs at the following speeds:

  • Windows NT 3.5 and later: The system timer runs at approximately 10ms.
  • Windows NT 3.1: The system timer runs at approximately 16ms.
  • Windows 95/98/Me: The system timer runs at approximately 55ms.

If you need a higher resolution timer than DOSTIME provides, you can use a high resolution timer or a multimedia timer, calling the relevant API functions from OpenInsight. Refer to the Microsoft documentation for details on the API functions. Refer to Creating BASIC+ Callable Functions for details on calling these functions from OpenInsight.

See Also

timeGetTime() API call

Example

call dostime(current_time)
/*
Suppose current_time returns 60616.3580. 
This translates to 4:50:16 p.m. with .3580 remainder, calculated as follows:
 
4 p.m. = 16 * 60 * 60 = 57600 seconds, remainder 3016 seconds
50 minutes = 3000 seconds, remainder 16 seconds
 
The accuracy of the .3580 remainder depends on the operating system, 
and probably should not be relied on beyond 1/10 of a second. 
*/
  • No labels