View Single Post
Old 11-23-2003, 07:36 PM   #1 (permalink)
Marburg
Crazy
 
Location: Nova Scotia, Canada
Wait() Command in C?

(if this isn't an apropriate place to post this I appologise)

Ok here's the thing.
I'm one of those extreamly dorky kids who didn't have any computer related class in public school but learnt a few programming languages anyway.
So now that I'm finally in university (csci) first year has been a breeze.

Anyway, enough stupid background info.

I'm making a program that creates a silly little ascii graphic, but it's supposed to be animated and change (using clrscr() in the non-standard conio.h)

Here's my problem though. I want there to be a short delay in between each update of the picture. (so it doesn't flicker as an unconprehensibale speed)

What I'm looking for is a function something like
Code:
void wait(int time);
where time is the amout of time you want the program to wait untill it executes the next statement.

So far I'm just lagging the program with a horrible, horrible recursive function. It works rather well but it's an awful hack.

Any suggestions would please me to no end.

ps. please forgive the large amount of personal pronouns!
__________________
Ask a simple question... get pain.
Marburg is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73