+ 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
2 Answers
+ 4
https://stackoverflow.com/questions/728068/how-to-calculate-a-time-difference-in-c
+ 1
5
3
1 2 3 4 5