| | |
delay() or sleep()
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Mar 2008
Posts: 44
Reputation:
Solved Threads: 3
in turbo C++ there is a function called delay(); and in microsoft compiler i guess it is sleep or msleep. what could be the possible equivalent function which can be used when compiling in GCC.
using the looping technique will give different time difference in different machines. is it true?
also i would like to know how to change the text colors.
the turbo c++ offers setcolor/textcolor function. what is the equivalent of it in the GCC.
using the looping technique will give different time difference in different machines. is it true?
also i would like to know how to change the text colors.
the turbo c++ offers setcolor/textcolor function. what is the equivalent of it in the GCC.
Last edited by rje7; Apr 11th, 2008 at 2:02 am.
•
•
Join Date: Jun 2007
Posts: 275
Reputation:
Solved Threads: 45
For microsoft windows, the Sleep and SleepEx functions provide delays.
In Linux you can use the usleep function.
I don't know any GCC-specific delay command, nor any portable delay command. If you want to make it portable, you might have to roll your own, or use condition compilation to use a different OS delay function depending on the OS used.
In Linux you can use the usleep function.
I don't know any GCC-specific delay command, nor any portable delay command. If you want to make it portable, you might have to roll your own, or use condition compilation to use a different OS delay function depending on the OS used.
•
•
Join Date: Mar 2008
Posts: 44
Reputation:
Solved Threads: 3
•
•
•
•
For microsoft windows, the Sleep and SleepEx functions provide delays.
In Linux you can use the usleep function.
I don't know any GCC-specific delay command, nor any portable delay command. If you want to make it portable, you might have to roll your own, or use condition compilation to use a different OS delay function depending on the OS used.
![]() |
Other Threads in the C++ Forum
- Previous Thread: Polynomial operators-addition,substraction,division,remainder etc
- Next Thread: Help, Assertion Problem :((
Views: 16756 | Replies: 5
| Thread Tools | Search this Thread |
Tag cloud for C++
6 add api array arrays beginner binary bitmap c++ c/c++ calculator char class classes code compile compiler console conversion convert count data delete desktop directshow dll encryption error file forms fstream function functions game getline givemetehcodez google graph homeworkhelper iamthwee ifstream input int integer java lazy lib linkedlist linux loop looping loops map math matrix memory microsoft newbie news node number output parameter pointer problem program programming project proxy python random read recursion recursive reference return sort string strings struct studio system template templates test text tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






