Posted: Fri May 26, 2006 5:11 pm
As youre going to create a thread you directly could use the API way pointed by Psychopanta and me.
http://www.purebasic.com
https://www.purebasic.fr/english/
Honestly, threads are overkill for such an easy thing as a timer.inc. wrote:As youre going to create a thread you directly could use the API way pointed by Psychopanta and me.
I meant: If thinking about a thread approach, do better use the API instead of a thread. (my english = my faultKale wrote:Honestly, threads are overkill for such an easy thing as a timer.inc. wrote:As youre going to create a thread you directly could use the API way pointed by Psychopanta and me.
please note that if you model a real app on this, the last REPEAT/FOREVER loop (or any other form of loop for that matter) needs an extra Delay to reduce processor load, as in:srod wrote:You'll need to use the debugger to kill the following:
Code: Select all
Global timerquit Procedure Timer1(time) ;time is in milliseconds Repeat Delay(time) Debug 1 Until timerquit=1 EndProcedure ;fire the timer every second: CreateThread(@timer1(),1000) Repeat ForEver
Code: Select all
Global timerquit
Procedure Timer1(time) ;time is in milliseconds
Repeat
Delay(time)
Debug 1
Until timerquit=1
EndProcedure
;fire the timer every second:
CreateThread(@timer1(),1000)
Repeat
Delay(1)
ForEver