Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. long starttime = get_time(); // Just a function to get the time
  2. long timeslice_id = get_scheduler_timeslice(); // This is what I am looking for
  3.  
  4. do_lengthy_things();
  5.  
  6. print("Code took %d ms to run.", get_time() - starttime);
  7.  
  8. if (get_scheduler_timeslice() != timeslice_id)
  9. print("There was a task switch while running this code, don't wonder about the time.");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement