I am creating a small windows form application using Visual C++; and I would need to delay a loop by a second. Sleep() doesn't work.(Not sure why) Is there a way I can use the timer? Any suggestions on how can I do that?
why don't you make your own function using <ctime>? Just let it loop for a second every time.
Yeah, Tigran, that was a good idea.
I did something like
Time b,c; // class Time, Constructs a Time object that is set to
// the time at which the constructor executes.
// the rest is pretty clear.
int t1 = b.get_seconds(); // seconds at that time. when b was created;
Time c; t2 = c.get_seconds(); if (t2==t1+5) break; // creates //new c each time, (+5) indicates 5 seconds delay.
But anyways, I would like to know how Timer works in Visual c++.