Why does the function "sleep" only waits the time I tell it to when starting the proyect instead of after something before it already happened

44 Views Asked by At

the code waits 2 seconds and then writes "hello world goodbye world" instead of writing hello world and waiting 2 seconds to write goodbye world

btw this is the code:

cout<<"Hello World"; 
sleep(2.0);
cout<<" Goodbye World";
return 0;
0

There are 0 best solutions below