
-----------------------------------
hamid14
Tue Apr 20, 2010 10:58 am

delays like turing
-----------------------------------
Is there anyway to put in delays in dev-c++ like in turing? Thanks, im new to c++ btw.

-----------------------------------
chrisbrown
Tue Apr 20, 2010 11:07 am

RE:delays like turing
-----------------------------------
To pause execution for 1 second:

On windows:
[code]#include 

int main() {
    Sleep(1000);
}[/code]

On *nix:
[code]#include 

int main() {
    sleep(1000);
}[/code]

Note the case difference in s/Sleep.

-----------------------------------
hamid14
Wed Apr 21, 2010 7:13 am

Re: delays like turing
-----------------------------------
i dont want it to stop completely for 1 second, i want it to slow down so I can actually see the numbers decreas on screen in the cmd. Thanks for the sleep function though, will use it.  :)

-----------------------------------
chrisbrown
Wed Apr 21, 2010 11:42 am

RE:delays like turing
-----------------------------------
That's what both sleep and delay do, they pause execution. You can't tell a computer to go slower, it executes instructions as fast as it is capable.

-----------------------------------
BigBear
Wed Apr 21, 2010 2:26 pm

RE:delays like turing
-----------------------------------
Turbo button?

-----------------------------------
hamid14
Wed Apr 21, 2010 3:24 pm

Re: delays like turing
-----------------------------------
oh ok, I understand. Thanks for the info. guys!  :o
