Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Linux Timer functions.

Hi,
I'm trying to use the timer functions in linux. setitimer() getitimer.
What I'm trying to do is get the program to execute a loop for a certain amount of time, but for the life of me I can't figure out how to use the above two functions to do that.
Is there anyother way ?

pseudo code is something like this.

while(timer not expired)
{
do some code here...
}

Comments

  • stoberstober Member Posts: 9,765 ✭✭✭
    : Hi,
    : I'm trying to use the timer functions in linux. setitimer() getitimer.
    : What I'm trying to do is get the program to execute a loop for a certain amount of time, but for the life of me I can't figure out how to use the above two functions to do that.
    : Is there anyother way ?
    :
    : pseudo code is something like this.
    :
    : while(timer not expired)
    : {
    : do some code here...
    : }
    :
    :

    sleep(milliseconds I think);

Sign In or Register to comment.