Is there a way to make a something happen when a time is reached, because, I tried this code, and it doesn't work at all, I think that it could be because of clock inaccuracy that is causing it...
Any thoughts?Code:#include <iostream> #include <stdlib.h> using namespace std; int main(int argc, char *argv[]) { int x; srand( (unsigned)time( NULL ) ); x = rand() % 10; time_t begin; begin=clock(); if(clock() == 5000) { cout << x << endl; } system("Pause"); return 0; }