hi,
i want my code to execute a set of functions keeping a certain time gap between the executions. how do i do that?
thanks
hi,
i want my code to execute a set of functions keeping a certain time gap between the executions. how do i do that?
thanks
what compiler and operating systems. *nix uses sleep(int seconds) and MS-Windows uses Sleep(long milliseconds) (note spelling differences). MS-DOS Borland compilers like TurboC uses delay(). I don't know about other operating systems.
actually i want to disply an object moving down on a xwindow. so i used the following method. but now i want to display an arbitrary numer of such objects dropping at different times, different different x cooordinates.
so this is the the whole pictureCode:while(j<height_window) { XSetForeground(disp,gc,BlackPixel(disp,DefaultScreen(disp))); XFillArc(disp, win, gc, 300-(30/2), j-(30/2), 30, 30, 0, 180*64); XFlush(disp); usleep(20000); c1++; if(c1>20) { j=j+10; XSetForeground(disp,gc,WhitePixel(disp,DefaultScreen(disp))); XFillArc(disp, win, gc, 300-(30/2), j-10-(30/2), 30, 30, 0, 180*64); }
the
part
shouldn't be thr.Code:if(c1>20) {
You could have just pressed the <Edit> button and removed it.Originally Posted by sourdon
I suppose you might have to implement threads to do that where each object type is in its own thread.
how do i do that in c
depends on the os. you posted usleep() so I think you are using some version of *nix.
here is a tutorial
thanx man