JCL Help:TJclWaitableTimer.SetTimer

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Activates the timer.


Pascal

 public function SetTimer(const DueTime: Int64; Period: Longint; Resume: Boolean): Boolean;


Parameters

Parameters Description
const DueTime: Int64 Specifies when the timer becomes signaled. A positive value indicates an absolute time in UTC and TFileTime format (you must convert a time expressed in UTC from a TFileTime to an Int64). A negative value indicates a relative time in 100 nanosecond intervals.
Period: Longint Period of the timer in milliseconds. A 0 period causes the timer to become signaled only once while a value greater than 0 causes the timer to periodically become signaled. Note that a periodic manual-reset timer remains in the signaled state until it is explicitly reset.
Resume: Boolean Specifies whether to restore a system in suspended power conservation mode when the timer state is set to signaled.


Return Value

If the function succeeds the result is True, otherwise it is False. In the latter case you can call GetLastError to get extended error information. Note that if you set Resume to True on a platform which doesn't support this, the method succeeds (returns True) but calling GetLastError will return ERROR_NOT_SUPPORTED.


Description

The SetTimer method activates the timer. When the DueTime arrives the timer is set to the signaled state and threads waiting for the timer using one of the WaitXxx functions become eligible for execution. If the timer was already active (in its signaled state) the timer is reactivated with the new parameters without releasing any waiting threads.


About

Donator

Marcel van Brakel


Contributors

Anonymous


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page