If you compile with C++11, you can do this cross-platform. This is a better option*:
1 2 3 4 5 6 7 8 9
#include <thread>
#include <chrono>
#include <iostream>
int main()
{
std::this_thread::sleep_for(std::chrono::seconds(5));
std::cout << "I love you" << std::endl;
}
s.b I mean using c ++ standard library to write. Do not mention me with windows, that is an alternative. If you look at the windows kernel source code, you will feel how bad windows! Bug too much. I suggest you still use linux or like unix. After all, Unix and linux stability. If you do not think of my idea, that does not matter.