Themuppeteer
Programmer
Hello guys,
I have a program that uses the settimer function.
There is an alarm system behind it,and there has to be able to set a delay between the occurence of the alarm and the actual reporting of it.
Anyway, the delay is most of the time not correct! I did not program the timer stuff (somebody else did), but I have to solve the problems now. Shouldn't it be better to poll for the system time in every loop and copare to that instead of having a system where every second the timer function sets a boolean to true ? I think the guy did it for performance reasons but I'm not sure.
Do you know a explanation why the setitimer does not work fine ?
Does polling for the system time every loop take a lot of the cpu ?
Any hints ? remarks ?
thnx!
Greetz,
NOSPAM_themuppeteer@hotmail.com (for mails, remove the NOSPAM_)
"Those who say they understand chess, understand nothing"
-- Robert HUBNER
I have a program that uses the settimer function.
There is an alarm system behind it,and there has to be able to set a delay between the occurence of the alarm and the actual reporting of it.
Anyway, the delay is most of the time not correct! I did not program the timer stuff (somebody else did), but I have to solve the problems now. Shouldn't it be better to poll for the system time in every loop and copare to that instead of having a system where every second the timer function sets a boolean to true ? I think the guy did it for performance reasons but I'm not sure.
Do you know a explanation why the setitimer does not work fine ?
Does polling for the system time every loop take a lot of the cpu ?
Any hints ? remarks ?
thnx!
Greetz,
NOSPAM_themuppeteer@hotmail.com (for mails, remove the NOSPAM_)
"Those who say they understand chess, understand nothing"
-- Robert HUBNER