Anyone could help this? I am using a MSVC++ compiler.. Thanks a lot..
koban_alche 0 Newbie Poster
Recommended Answers
Jump to PostHere you go :
#include <iostream> #include <ctime> //for clock() using std::cout; void Delay(float milliSeconds) { const float clk_strt = float(clock()); while( clock() - clk_strt < milliSeconds ) continue; } int main() { for(int i = 0; i < 10; i++) { Delay(1000); //1000 milli seconds = …
Jump to PostThat takes too much processing and CPU time. Just use the win32 api function Sleep(int seconds), and don't forget to include windows.h header file.
All 6 Replies
mrnutty 761 Senior Poster
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
vmanes 1,165 Posting Virtuoso
Grn Xtrm 84 Posting Pro in Training
mrnutty 761 Senior Poster
Tom Gunn 1,164 Practically a Master Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.