sleep function

Hi there,
I made a small C++ program that consists in checking if an hour and a minute of a day as become to copy a file to another location. The program was working pretty fine until i've noticed that it was consuming 50% of the processor (a core 2 duo :S). I have noticed that is the sleep function that causes this... and i don't know how to handle this because i believe that the sleep is usually peacefull to the processor... I made the program in DEV/CPP, a windows developer/compiler that works under gCC. Can anyone help me?
What OS are you working on? Windows?
yes, windows
Well, the problem is most likely that you are not reaching the Sleep()...can you post some code?
How long are you sleeping? and your not doing something like

1
2
while (true) 
 sleep(1);

?
Topic archived. No new replies allowed.