Hi, i get overflow error when i want my program to sleep 200000. What do i do if i need my program to sleep for a looooong time? :)
Printable View
Hi, i get overflow error when i want my program to sleep 200000. What do i do if i need my program to sleep for a looooong time? :)
You'll need to maintain another counter and do several sleeps. Concept similar to hours and minutes... when your gonna "overflow" the 60 minute mark you reset minutes to zero and increment hour.
ok thx :)
Passing 200000 to the Sleep API shouldn't be a problem since it takes a Long as the parameter. Do you have the correct declaration?
However I don't think it's such a good idea to call sleep with such a high number since your application will not respond during that time and will appear as hung.