Forum in READ ONLY mode! All questions and discussions on Discord official server, invite link: https://discord.gg/VxsGzJ7

evTimer question

Ask for help
Post Reply
verbin
Neophyte
Neophyte
Posts: 18
Joined: 20.01.2015 23:46

evTimer question

Post by verbin »

Code: Select all

Program New;
procedure timer1();
begin
  uosay('this sub thread');
end;
begin
SetEventProc(evTimer1,'timer1'); 
while true do
begin
 uosay('this main thread');
 wait(10);
 end;
end.
this code,timer1 Don't work
and....where set Time interval? User manual is Russian,not english
SetEventProc function is Multi thread or Single thread?
Gauhar
Novice
Novice
Posts: 87
Joined: 08.07.2008 17:40

Re: evTimer question

Post by Gauhar »

Sorry for my bad English.
Maybe on your shard works antispam?
I tested your script with AddToSystemJournal:

Code: Select all

17:38:25:984 [Local-A]: Compiling
17:38:26:031 [Local-A]: Compiled succesfully
17:38:26:031 [Local-A]: this MAIN thread
17:38:26:046 [Local-A]: this MAIN thread
17:38:26:062 [Local-A]: this MAIN thread
17:38:26:078 [Local-A]: this MAIN thread
17:38:26:109 [Local-A]: this MAIN thread
17:38:26:125 [Local-A]: this MAIN thread
17:38:26:140 [Local-A]: this SUB thread
17:38:26:140 [Local-A]: this MAIN thread
17:38:26:171 [Local-A]: this MAIN thread
17:38:26:187 [Local-A]: this MAIN thread
17:38:26:203 [Local-A]: this MAIN thread
17:38:26:218 [Local-A]: this MAIN thread
17:38:26:234 [Local-A]: this SUB thread
17:38:26:234 [Local-A]: this MAIN thread
17:38:26:250 [Local-A]: this MAIN thread
17:38:26:265 [Local-A]: this MAIN thread
17:38:26:281 [Local-A]: this MAIN thread
17:38:26:296 [Local-A]: this MAIN thread
17:38:26:312 [Local-A]: this MAIN thread
17:38:26:328 [Local-A]: this MAIN thread
17:38:26:343 [Local-A]: this SUB thread
17:38:26:359 [Local-A]: this MAIN thread
17:38:26:375 [Local-A]: this MAIN thread
17:38:26:390 [Local-A]: this MAIN thread
17:38:26:406 [Local-A]: this MAIN thread
17:38:26:421 [Local-A]: this MAIN thread
17:38:26:437 [Local-A]: this MAIN thread
17:38:26:437 [Local-A]: this SUB thread
17:38:26:468 [Local-A]: this MAIN thread
17:38:26:953 [Local-A]: Succesfully executed
17:38:26:953 [Local-A]: Script test evTimer.sc stopped successfuly
User avatar
Vizit0r
Developer
Developer
Posts: 3958
Joined: 24.03.2005 17:05
Contact:

Re: evTimer question

Post by Vizit0r »

period is constant = 100ms
SetEventProc function is Multi thread or Single thread?
works in same thread, where handler setted.

btw, in russian manuals this also not written ))
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
Post Reply