LeTay
asked on
Two TTimer components in a Delphi XE10 service
I have developped a service using Delphi XE10.1 Berlin.
One timer interval is T1, the other is T2 (20 and 120 seconds respectively).
The first when activated, processes some input and send emails using email component accordingly.
The second just write a line in a log file.
Sometime the input to process is very large, and it can last for 3 minutes.
What is strange, is that the other timer, that should be activated during that interval is not.
Is this related to the heavy work of the other ?
Shall I place a kind of ProcessMessages (not available in TService component) or something else to have the second timer working during the working time of the first one ?
Thanks
One timer interval is T1, the other is T2 (20 and 120 seconds respectively).
The first when activated, processes some input and send emails using email component accordingly.
The second just write a line in a log file.
Sometime the input to process is very large, and it can last for 3 minutes.
What is strange, is that the other timer, that should be activated during that interval is not.
Is this related to the heavy work of the other ?
Shall I place a kind of ProcessMessages (not available in TService component) or something else to have the second timer working during the working time of the first one ?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Better use TimeSetEvent/timeKillEvent functions as in this example (inside of thread) with TIME_ONESHOT option.
ASKER
Is it easy to have the second timer in a TTHread ?
Some example ?
Thanks
Some example ?
Thanks
ASKER
Will have a look at Sinisa Vuk example
ASKER
Will try to incorporate the work of one timer into the other ...