C++ Sleep Function (works on non Windows! Linux and Unix Compatible!)
IN this article I will give you a piece of code that will allow you to make your C++ programs sleep, even if you are not using Windows and therefore cannot include windows.h!
This article is part of a series of my articles containing snippets of C++ code that will perform various functions. Feel free to use them or modify them as needed, AS LONG AS YOU DO NOT RE-PUBLISH THEM. Wheter you need an inspiration for a project, a way around a coding problem, or you are just curious feel free to check out the table of contents to my series right here.
void sleep(unsigned int mseconds)
{
clock_t goal = mseconds + clock();
while (goal > clock());
}
/* Nesecary includes: Code */ void sleep(unsigned int miliseconds) { clock_t goal = miliseconds + clock(); while (goal > clock()); }
-
list of linux based operating system
| By gopi | in Computers
list of linux based operating system. 32 bit and 64 bit...
-
Tux ahoy! My experiences with LINUX
| By thestickman | in General
I have switched Linux Distros. Again. I’m wearing TUX... "Tux" in geekdom implies penguins. And penguins in th...
-
What does Windows have that Linux Doesn't?
| By Holyjoely | in General
I recently submitted a poll to a fairly popular tech site and found that, although people did use Linux, the majori...
-
How to Run Linux on Your Computer
| By dsj8760 | in Software
Whether you want to just test out Linux or you want it to be your operating system of choice, this article will des...
-
The Choice of Programming Language for Linux isn’t an Easy One!
| By medusawrite | in Programming
this article covers some programming languages uesd and imlemented in the linux OS...
-
XA Transaction - Solution for Transaction More Than One Database | By H4d1 | in Programming
Have you ever think that it's too difficult for making database transaction in two different places (or databases) ...
-
Javascript functions for : trim, right trim, left trim, no Apostrophe, is Empty , is Digit , VarChar To Number , is integer , check Is Zero , Get Que | By xxris | in Programming
Javascript functions for : trim, right trim, left trim, no Apostrophe, is Empty , is Digit , VarChar To Number , i...
-
How to access and use a Window's command line | By MaxwellPayne | in Programming
Learn about the Window's command line in DOS and how to use it....
-
How to Learn to Program Your Computer | By dsj8760 | in Programming
This article is about learning to program a computer. It is a general article giving tips on how to learn about pro...
-
Jailbroken iPhones get RickRolled | By explorer | in Programming
First iPhone worm, attacks via SSH and does the classic rick roll gag on the user....
-
How to burn an ISO | By zwrites | in Computers
Have you ever wondered about the mysterious ISO, or have you ever tried burning one only to be surprised to find it...
-
How to use a Custom Pause message in a C++ Program | By zwrites | in Software
In this article I will share a piece of code that will allow you to create your own system ("PAUSE") mess...
-
How to center a one line message in a C++ program | By zwrites | in Programming
In This article I will show a code snippet that will center your message in a C++ console application....
-
Insert spaces before output C++ | By zwrites | in Programming
This code snippet will output the desired number of spaces in your C++ program....
-
How to get a backup WAD of Swords and Soldiers (WiiWare) | By zwrites | in Computer & Video Games
In this article I will give you information on the popular WiiWare title: Swords and Soldiers and how to attain a b...







No comments yet.