title: How can I theoretically program a stopwatch?
body: <p>This is my first question on stackoverflow.com, so please, be lenient for me :) I have a problem about how do I theoretically create a stopwatch program. It doesn't matter for me which language it would be written in. Is this theoretically OK?</p>
  
  <pre><code>a = 0
  While 1 == 1:
      Print(a)
      Sleep(1s)
      a = a+1
  </code></pre>
  
  <p>This for my eye should be OK, but when running similar thing in Python, it doesn't print it accurately. Measuring it with my "real-life" analog stopwatch, it sometimes is less than 1 second, and sometimes more than 1 second. What i would like to know is how to only theoretically create a stopwatch, I don't need an actual code. I hope you understand my question, awaiting reply :)</p>