title: Creating a second-counter in C for Gameboy
body: <p>So I am new to C and have been assigned the task of making a game. I'll be using a Gameboy emulator and have been discouraged from importing any libraries beyond the basics.</p>
  
  <p>I would like to come up with a way to run a second-counter (that will display on screen,) but unable to use the <code>time.h</code> library, I feel a bit stuck.</p>
  
  <p>Is there anyway I could go about doing this?
  I was told that Gameboy runs rather slow, and if I could get it caught in a 'busy loop' I could 'approximate a second' and count that way.</p>
  
  <p>I've considered the <code>sleep</code> function to do this, but that's in <code>unistd.h</code> library.
  I've also considered perhaps setting up a loop and counting up to 10 thousand (or whatever number may take a second to calculate,) but all of this will be happening simultaneously to the game at hand, and I am afraid things like that will delay the gameplay and other things happening.</p>
  
  <p>Any recommendations?</p>
  
  <p>Edit: I think anything beyond <code>stdlib.h</code> and <code>stdio.h</code> is disallowed.</p>