|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
problems with the sleep function...
(in Linux)
when i use the sleep function, it looks like it works, but rather strangly... so if i do: sleep(1); puts ("hello!!!"); sleep(1); puts("hi!"); it will freeze and when it unfreezes, it will display: hello!!! he! instantly, without the 1 secound pause that was supposed to be between them. thanks to every1 that will be kind enough to help... |
|
#2
|
||||
|
||||
|
Your code worked fine for me on Red Hat 7.0.
I assume that you are just running it straight from the command line and not redirecting or piping the output. For example, when I piped the output to more, I got the same behavior that you described. That would tell me that for some reason your output is getting buffered somewhere and isn't getting written to stdout until the program exits. Tell me, when you say that the system freezes, does it freeze for just about two seconds? Last edited by dwise1_aol : April 9th, 2003 at 02:11 PM. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > C Programming > problems with the sleep function... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|