+ 1

how can we calculate the time taken by a given code snippet in c++?

Suppose we want to calculate the time taken by a given code snippet in c++, how to do that, if possible, on sololearn? Is there any pre defined function or STL that we can use for this purpose? I searched online on geeksforgeeks and they recommended using chrono but it doesnt seem to work on sololearn? well, it works on codeblocks i have linked a code using chrono whose inputs are given below in answers, just copy paste it https://code.sololearn.com/c0TS4UKxC6Kc/?ref=app

21st Jul 2019, 11:32 AM
Saurabh Tiwari
Saurabh Tiwari - avatar
2 Respuestas
+ 4
https://stackoverflow.com/questions/728068/how-to-calculate-a-time-difference-in-c
21st Jul 2019, 12:13 PM
blACk sh4d0w
blACk sh4d0w - avatar
+ 1
5 3 1 2 3 4 5
21st Jul 2019, 11:33 AM
Saurabh Tiwari
Saurabh Tiwari - avatar