[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
SETTIC()
Increases number of time ticks to produce a more precise time measurement
------------------------------------------------------------------------------
Syntax
SETTIC([<lAcceleration>]) --> lAccelerated
Arguments
<lAcceleration> When this parameter is .T., the number of timer
ticks is increased by a factor of 128. The default is normal timer
ticks (.F.).
() With no arguments, SETTIC() returns the current status of the timer
as a .T. when accelerated; .F. if it is not.
Returns
The SETTIC() function returns .T. when the timer is accelerated;
otherwise, it returns .F..
Description
If the integrated timer in your computer uses SETTIC(.T.) to accelerate,
then the number of ticks per second increases from 18.2 to around 2500.
This makes time measurement more precise and allows you to compare the
speed of different routines more accurately.
The computer's clock time, which is also based on the timer tick,
continues to operate correctly.
Notes
Warning! You must uninstall SETTIC() before you leave a program;
otherwise, you will hang the system. However, if the Extended Drivers
CTUS.LIB is linked in, then SETTIC() uninstalls automatically when you
exit the program.
. As long as the timer is accelerated, you cannot implement the
KEYSEC(), SHOWTIME(), and SHOWKEY() functions because they use the
timer tick. Therefore, you must uninstall these functions before you
implement SETTIC(.T.).
. Do not place (link) SETTIC() within an overlay, since an
interrupt service routine can never be within an overlay. Of course,
you can call SETTIC() from an overlay.
. Since each timer tick must call an interrupt service, your
program's execution speed decreases.
Example
Measure an individual UDF in ticks. The tick rate increases first, and
then decreases after UDF is executed and the number of resulting ticks
is queried:
SETTIC(.T.)
MY_UDF(I) // Needs to be measured...
SETTIC()
? "Required ticks:", GETTIC()
See Also:
GETTIC()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson