I made this for my other projects on the 13th (September). What it does is stops the message for specified time. Default is 3 seconds. NOTE: you need both .cpp and .h for this to work. Please leave the comments in it.
STOPCLOCK.H
//////////////////////////////////////////////////
//////// StopClock.h /////////////////////////////
//////// Put together by: Hunter Huttger /////////
//////// Aliases: prototype, hhuttger ////////////
//////// Date Created: Sep 13, 2009 //////////////
/************************************************/
//////// Used for: call the function to stop /////
//////// the text being shown for specified //////
//////// time. NOTE: This is only used in ////////
//////// Windows. Linux users have no use ////////
//////// for this. Please use responsibly. ///////
/************************************************/
//////// Used with: StopClock.cpp ////////////////
//////////////////////////////////////////////////#ifndef STOPCLOCK_H
#define STOPCLOCK_Hvoid StopClock();
#endif
STOPCLOCK.CPP
//////////////////////////////////////////////////
//////// StopClock.cpp ///////////////////////////
//////// Put together by: Hunter Huttger /////////
//////// Aliases: prototype, hhuttger ////////////
//////// Date Created: Sep 13, 2009 //////////////
/************************************************/
//////// Used for: call the function to stop /////
//////// the text being shown for specified //////
//////// time. NOTE: This is cross platform //////
//////// so all you Linux and Windows users //////
//////// can use this too.///////////////////
/************************************************/
//////// Used with: StopClock.h //////////////////
//////////////////////////////////////////////////#include
#include
#includevoid StopClock()
{
int seconds = 1;
#ifdef WIN32
Sleep(seconds*3000); // Change the 3000 to whatever you want (hint: 3000 == 3 seconds)
#else
sleep(seconds);
#endif
}
I know it’s really simple. But it works.
To use the function in your code put
StopClock();
When you want to freeze time.
If you have any name suggestions for me, please let me know.