ID Number: Q83859
1.00
WINDOWS
docerr
Summary:
The TIMER function in Microsoft Test uses the Windows API routine
GetTickCount, which returns the number of milliseconds since Windows
was started. A program example below demonstrates this.
Contrary to the documentation, the TIMER function does NOT return the
number of seconds since midnight. Instead, it returns the number of
milliseconds since Windows was started.
This information applies to Microsoft Test version 1.0 for Windows.
More Information:
Example of TIMER Function
-------------------------
1. Start the Test driver.
2. From the Window menu, choose Show Viewport to be able to see the
output.
3. Enter the following code:
print "the date and time = ";datetime$
ret& = timer 'return the time in millisecond into a long
print ret& 'this will print the time since Windows was last started
sleep 3 'wait 3 seconds or more if other Windows processes are running
print "date time 2 = ";datetime$ 'print the new time
ret& = timer 'get the new timer return value and print it
print ret&
4. From the Run menu, choose Start to run the Test script.
5. Click on the Viewport window and note that the timer function is a
number in milliseconds. To verify that this is the amount of time
since the Windows session was started, save the Test script, exit
Windows, and restart. Then run the timer test again, and note that
the values returned by the timer function will be much smaller.
Documentation Corrections
-------------------------
The following corrections apply to page 541 of the "Microsoft Test:
for Windows User's Guide" version 1.0 manual and to the online Help
(MSTEST.HLP) section for the TIMER function:
- The following description for the TIMER function is incorrect
The TIMER function gives the number of seconds (in
hundredths) since midnight.
and should be changed to read as follows:
The TIMER function gives the number of milliseconds since
Windows was started.
- Because the TIMER function returns a LONG integer, the following
syntax example is incorrect
Ret% = TIMER
and should be changed to read as follows:
Ret& = TIMER
For a complete list of documentation corrections for Microsoft Test
for Windows, query in this knowledge base on the following words:
MSTEST.HLP and README.WRI and Guide and corrections
Additional reference words: 1.00 time