Important: The information in this document is obsolete and should not be used for new development.
TickCount
You can use theTickCount
function to get the current number of ticks (a tick is approximately 1/60 of a second) since the system last started up.
FUNCTION TickCount: LongInt;DESCRIPTION
TheTickCount
function returns a long integer that indicates the current number of ticks since the system last started up. You can use this value to compare the number of ticks that have elapsed since a given event or other action occurred. For example, you could compare the current value returned byTickCount
with the value of thewhen
field of an event record.The tick count is incremented during the vertical retrace interrupt, but this interrupt can be disabled. Your application should not rely on the tick count to increment with absolute precision. Your application also should not assume that the tick count always increments by 1; an interrupt task might keep control for more than one tick. If your application keeps track of the previous tick count and then compares this value with the current tick count, your application should compare the two values by checking for a "greater than or equal" condition rather than "equal to previous tick count plus 1."
- WARNING
- Don't rely on the tick count being exact; it's usually accurate to within one tick, but this level of accuracy is not guaranteed.
ASSEMBLY-LANGUAGE NOTE
The value returned byTickCount
is also accessible in the global variableTicks
.