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.

>what could be the possible equivalent function which can be used when compiling in GCC

I guess you could use something from the <ctime> library

Not sure about the colour bit. Using the cursors library maybe?

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.

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.

which header files should i include?

This article has been dead for over six months. Start a new discussion instead.