Activate it in 1000 ms :)

Posted by ALB42 on 21. Juli 2011No Comments

Connected the OnActivate Event for Windows as requested.

As second Task I cared about Timers. The principle is rather easy, I just create an array of the call back routines, with the interval length and the time of last call. The time values are stored in a Type Ttimeval which is a record with two longwords one for second until 1.1.1978 and one for microseconds. When get the current system time you will always get rounded to 10 ms exact value… so why they extended it to microsecond? because they guessed for far far aways future… who knows. Exact timing better than 10 ms is also not possible in Windows (except you decrease the size of a time slice to 1 ms or so) because one time slice is around 15 ms (depends on Windows Version). So this is more than enough for the TTimer component in LCL. The time Interval should be always taken as the MINIMAL time before fire again (can be a little bit more always, like in windows/linux as well)

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert