title: How do I use the functions setitimer and getitimer?
body: <p>I'm trying to write a program in c that simulates a processor scheduler. Trying to figure out how to simulate timer interrupts i stumbled upon this thread: <a href="https://stackoverflow.com/questions/601012/setting-an-alarm-in-milliseconds-in-c">Setting an alarm in milliseconds in C</a></p>
  
  <p>I read through the man page that was linked but am still confused on how this works. Firstly to clarify the which field is to specify which timer type your working with(real, virt, prof)?</p>
  
  <p>Second, you pass in a struct called itimerval. What does this struct hold?</p>
  
  <p>Third, I'm assuming there's other pieces required to get this to work. Obviously a function to handle the signal produced by the timer, but can someone give me the bones for how this thing is supposed to work?</p>