This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

how to start and stop timer in sys/bios.

i want to start a timer and, then I am executing a function and then i want to stop the timer after the function stops executing, how do i do it?please do assist.

  • Hi,

    Yes there is an API to create a Timer, start a Timer and stop a Timer.  Please look at the Timer cdoc.

    Judah

  • Say i am using clock,hwi,swi,task,idel,and TIMER,in differnt aspects based on real time events.so doubt is, what is the priority of TIMER in contrast with all other sceduling operation.

    And for example,say i start a timer inside a task,and after starting the timer will it execute the executing statments next "timer start statement" parallely.. i mean along with the timer running at background?plaese to assist me

  • The priority is from High to Low:

    HWI - Timers run at Hwi level

    SWI - Clocks run at Swi level

    TASK

    IDLE

    Not quite following your question "after starting the timer will it execute the executing statements next timer start statement".
    When you start a timer, when the timer reaches its period it will generate an interrupt and the function you associated with the timer will execute.
    Meanwhile your program will continue to run the hightest Hwi, Swi, Task or Idle as it should be.

    If the Timer is in continuous mode then it will continue to generate an interrupt when it reaches its period, otherwise it will generate only 1 interrupt and you
    need to run Timer_start again.

    Judah

  •     okay thank you,what u say is the moment timer sarts,it will excecute parrellely,along with the nomal operation of schedulor(such as running HWI/SWI/or task/IDLE).

    and the timer operates in HWI level.

    1. MY doubt is ,if such is the case the schedular wont transfer the control to the any other HWI/SWI/TASK,rightt??

    2. considering the below example after timer starts,the instructions below that will get excecuted paralley... correct right?

     

    timer _start()

    instruction x;

    instruction y;

    fun1();

    please do correct me if am wrong