Second: before you use the cin command get the milliseconds elapsed until then from the start of the program using the method timeGetTime() and keep it intro a double, and in a second double keep the elapsed seconds until then from the start of the program, and substract from it the first double to get the time taken by the user to input
Apparently, Linux implements clock() by measuring how much CPU time the program has used. Since I/O doesn't consume CPU time...
I think it should work if you replace "clock()" with "time(0)". You'll get the number of seconds.
I see and thank you.
time(0) works, but not as accurate as I want.
Now I am using system("date") to get the time. But I don't like it. So, under Linux, how can I get the accurate time except using system()? I mean, how does the command date do it?