How to use timer in c++ CodeBlock -


k, hello trying make :"write program message on computer screen show how time remains before lesson end: if end of lesson there more 30 minutes printed report something...", tried:

#include <iostream> #include <cstdio> #include <ctime>  using namespace std; int main() {     int starttime = 1, endtime;      endtime = 30 * 3600;      clock_t start = clock();       cout<<"time: "<< start <<'\n';      if (start >= 7200)     {         //     } else if (start == endtime)     {         //     } } 

i want show time if time == number something. tried sleep(); reason got error in codeblock.

i got "sleep not declared in scope." try including library has it...

if you're in unix, #include <unistd.h>.

if windows, #include <windows.h>, use sleep() instead.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -