anyway, (2000-clock()>0) would show end 2s after hello ?
It might. It might not. The granularity of clock is implementation defined as is the initial value returned from clock at the beginning of a program (it is not required to be 0.) Spinning in a loop doing nothing is not a great recommendation unless you like 100% utilization of your cpu checking to see if it's done waiting. Use an operating specific function (such as Sleep on Windows) or if you have C++11 support:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
constchar* helloWorld = "Hello world!";
auto delay = std::chrono::milliseconds(500);
for (constchar* p = helloWorld; *p; ++p)
std::cout << *p;