How multithreading occurs in TTimer for animation usage? lazarus / 39-Graphics ---------------------------------------------------------------------- avv210 · 2022-04-19 12:55 Hey guys. I use the TTimer component in Lazarus for my animation, the method I use is sleep(). How does multithreading occurs in sleep()? Thank you ---------------------------------------------------------------------- Martin_fr · 2022-04-19 15:22 1) TTimer does not use threads. TTimer runs in the main thread. 2) Sleep only affects the thread that calls it. - Other threads are not affected - The thread that called "sleep" is blocked during the call. If this is the main thread, then timer events will be delayed until after the sleep. ---------------------------------------------------------------------- Dzandaa · 2022-06-29 08:34 Hi, There is the code I use for non blocking Sleep: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i // ************************************// **** Delay: Non Blocking Sleep *****// ************************************procedure Delay(Milis: qword);var  TimeSpend: qword;begin   TimeSpend := GetTickCount64;  while (GetTickCount64 < TimeSpend + Milis) and (not Application.Terminated) do    Application.ProcessMessages; end;