Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void some_function(){
- struct timeval tstart,tend;
- while (1){
- gettimeofday (&tstart, NULL);
- ...
- Some computation
- ...
- gettimeofday (&tend, NULL);
- diff = (tend.tv_sec - tstart.tv_sec)*1000000L+(tend.tv_usec - tstart.tv_usec);
- usleep(10000-diff);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement