When I run this code:
it sleep for the right amount of time, but it doesn't display the text. Why isn't the text being displayed? Thanks in advance.Code:#include <windows.h> #include <iostream.h> int sleep (int sleep_for) { int start=timeGetTime(); BOOL sleeping=TRUE; while (sleeping) { int current=timeGetTime(); if (current-sleep_for>=start) break; } return 0; } int main() { cout<<"YAY"; sleep(2000); return 0; }