fuzzylizard Posted November 6, 2003 Report Share Posted November 6, 2003 Hey, I am looking for a synonym of the sleep() function in C program that will cause the program to halt to a period of time, but won't shut the program down in the same way that sleep() does. My teacher mentioned it and now I can't remember what it was. Also, I trying to find a really good online C programming reference/community. Something that is aimed at newbies and pros alike. Any suggestions? Quote Link to comment Share on other sites More sharing options...
johnnyv Posted November 6, 2003 Report Share Posted November 6, 2003 what do you mean "won't shut the program down"? you may want to use the wait function look at man:/wait(2) in konq. also for a higher resolution sleep look at nanosleep man:/nanosleep take a look at this if you havent. http://www.gnu.org/software/libc/manual/ht...node/index.html Quote Link to comment Share on other sites More sharing options...
fuzzylizard Posted November 6, 2003 Author Report Share Posted November 6, 2003 From what I remember from what my teacher said, sleep stops the program from responding to signals for the duration that it is asleep. What I want to do is to create a little timer that will cause the program to stop for a second or two, but still respond to signals. I don't think I can do this with sleep. I will look into the wait command. The link looks great, thanks. Quote Link to comment Share on other sites More sharing options...
DOlson Posted November 8, 2003 Report Share Posted November 8, 2003 GetTimeOfDay() or something like that? I don't know, I don't use delays unless I'm only testing things. I just use time-based movement and such things as that. And since I use SDL because I'm doing games, I have access to SDL_Delay(), which does sorta what sleep() does I think... Anyhow, cprogramming.com is a decent forum and stuff, IMHO. But I'd like to build on this one here... No reason why not to, right? :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.