will there be an effect from WaitNextTimeSlice();. I want not to wait for time, but to give the flow.
Re: WaitUntil()
Posted: Thu Jul 14, 2022 4:30 pm
by TomKerekes
I don't understand the question.
It would be helpful to know what you are trying to do?
Why not use the existing functions Delay_sec() or WaitUntil()?
WaitNextTimeSlice(); waits until the beginning of the Threads next Time Slice. To just get the Time use Time_sec();
Your program never sets Time_start;
ms is normally used for milliseconds. But you are using it as seconds.
In general timing by a User Thread in software will not be perfect because Threads execute for ~50us and then stop executing for some period of time (ie ~130us for one Thread). If the Time expires while the Thread is stopped it will not be detected until the Thread resumes execution. This could extend the time by up to 130us.
Please indent your programs properly when asking other to help.