Class TTimer
Unit
Timer
Declaration
type TTimer = class(TSubsystem)
Description
Timer service classThe class can be used to measure time intervals as well as to bind a message generation or a delegate call.
Default implementation uses GetPerformanceCounter from OSUtils if available or less precise GetCurrentMs() otherwise. A custom implemetation can be easily connected.
ToDo: Make the class thread-safe.
Fields
| | Name | Description |
 | MaxInterval | This variable limits the time interval on which recurring events will be processed to prevent too much computations when a lot of time passed since last Process() call. Default value is 3 seconds. |
 | TimerQueryFunc | Timer query delegate. Can be overwritten to use a custom timer implementation |
Methods
Overview
Description
Returns time passed from previous call of the method with the same TimeMark variable and ModifyMark set to True. First call (with uninitialized TimeMark) returns 0 and performs initialization of the TimeMark.
Message handler. No messages need to be handled so it's empty.
Returns True if more then Intervak time passed from previous call of the method with the same TimeMark variable and ModifyMark set to True. First call (with uninitialized TimeMark) returns True and performs initialization of the TimeMark.
Processes timer events and returns delay to the nearest event. Events will be processed and therefore can emerge only within this method.
Removes the specified recurring event
Sets (binds) the specified delegate to call in Delay seconds. EventID is an application-specific identification number to supply the delegate with.
Sets (binds) a message of the specified class to generate in Delay seconds
Sets (binds) a message of the specified class to generate every Delay seconds starting from the moment of call. Returns an ID of the new event.
Sets (binds) the specified delegate to call every Delay seconds starting from the moment of call. EventID is an application-specific identification number to supply the delegate with. Returns an ID of the new event.
Changes interval of the specified recurring event
Properties
Overview
Description
Number of active events not including recurring ones
Number of active recurring events
|
Last modified: Jan 6, 2010
Copyright (C) 2006-2010, casteng.com
|