954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

difficulty in providing delay in gcc compiler

I have written a program in which there is a board and the balls should travel from one place to another.i need to provide a delay when i draw the ball in new position and erase it from previous position.I used delay() funtion on turbo c++.but on gcc compiler on linux i dont know how to provide delay.I used usleep() function but i cant see the successive movement of balls.what should i do?.please help..how do i write a delay loop

harry pottervs
Newbie Poster
2 posts since Jul 2008
Reputation Points: 10
Solved Threads: 0
 
// call :

system("pause"); // ||  system(pause);

// maybe..
cikara21
Posting Whiz
340 posts since Jul 2008
Reputation Points: 47
Solved Threads: 69
 

You can make your program to sleep

This link may be useful

Prabakar
Posting Whiz
342 posts since May 2008
Reputation Points: 94
Solved Threads: 33
 

Well did you take account of the fact that usleep takes MICROSECONDS?

delay(1000); and usleep(1000); will wait for different times.

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

@salem
yes i have given in terms of micro seconds only.
@prabhakar
link was useful!

harry pottervs
Newbie Poster
2 posts since Jul 2008
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You