Using <ctime> in cpp : Have you got the same output ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Using <ctime> in cpp : Have you got the same output ?

https://code.sololearn.com/cg99Tzn3t1zz/?ref=app

21st Jun 2017, 9:29 AM
clement
clement - avatar
2 Answers
+ 8
Same output for me. It is crucial to take note that SL compiler doesn't measure ticks really well, when compared to desktop compilers. (I'm not sure if it's a compiler issue, may be due to the environment or interface).
21st Jun 2017, 9:35 AM
Hatsy Rei
Hatsy Rei - avatar
+ 1
@Hastsy Rei If I want to use this sleep function in my program, do i need to first measure the eventualy spread of time of the compiler ? And then take it in charge in the function (time(0) < end - spread). EDIT (i figure out it doesn't work...)
21st Jun 2017, 10:14 AM
clement
clement - avatar