Controlling speed of a program

Feb 24, 2012 at 5:13am
I would like to know how I can make a program print a line that is timed so it isn't all at once confusing the user
Feb 24, 2012 at 5:50am
sleep(<time in ms>)
 
for (time_t t = time() + 5; time() < t; ) {}

google is your friend :) usually provide faster responses
Feb 24, 2012 at 11:47pm
Sorry for being sooo late, but why do I need the for statement
Feb 24, 2012 at 11:56pm
That's basically a loop that repeats until a certain time is reached, the problem here this will call time() as often as your processor or your OS will allow it, which is a huge waste of resources.
Feb 24, 2012 at 11:57pm
is there a better way
Topic archived. No new replies allowed.