V
Vasileios
Hi everyone.
I am trying to time how long a function takes to execute in c++.
Lets say I have a loop for example:
for (int i=0;i<1000; i++)
{
....do something useful here
}
I would like to measure how long this loop takes to execute in
miliseconds or seconds.
How can I do that?
I thought of using time() to get the current time before the loop, and
once again after the loop has finished.
However this doesnt seem very robust. Can you perhaps recommend
another way?
Thank you in advance
Vasileios Zografos
I am trying to time how long a function takes to execute in c++.
Lets say I have a loop for example:
for (int i=0;i<1000; i++)
{
....do something useful here
}
I would like to measure how long this loop takes to execute in
miliseconds or seconds.
How can I do that?
I thought of using time() to get the current time before the loop, and
once again after the loop has finished.
However this doesnt seem very robust. Can you perhaps recommend
another way?
Thank you in advance
Vasileios Zografos