stopwatch, timer....
-
Hello, my mfc application is performing a time consuming operation. Before this I want to prompt the user with an approximate estimate of the execution time. For this my idea was to execute some (eg 100) cycles, get the elapsed time and multiply this for the number of total needed executions. In MATLAB (for MATLAB users) it would be a simple tic - toc command. Is there something similar for VC++? Or do you have an idea for another approach? Thanks, Marco.
-
Hello, my mfc application is performing a time consuming operation. Before this I want to prompt the user with an approximate estimate of the execution time. For this my idea was to execute some (eg 100) cycles, get the elapsed time and multiply this for the number of total needed executions. In MATLAB (for MATLAB users) it would be a simple tic - toc command. Is there something similar for VC++? Or do you have an idea for another approach? Thanks, Marco.
Have a look at the CRT function clock(). A quick Google located: http://msdn.microsoft.com/msdnmag/issues/04/09/CQA/default.aspx[^] which should head you in the right direction. Also search CP for performance monitoring code. And maybe profile you code to speed it up as much as possible.:) Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
-
Hello, my mfc application is performing a time consuming operation. Before this I want to prompt the user with an approximate estimate of the execution time. For this my idea was to execute some (eg 100) cycles, get the elapsed time and multiply this for the number of total needed executions. In MATLAB (for MATLAB users) it would be a simple tic - toc command. Is there something similar for VC++? Or do you have an idea for another approach? Thanks, Marco.
marcomars wrote: my mfc application is performing a time consuming operation. Estimations aside, can you put this time-consuming operation in a separate thread? That way, no matter how long it takes or how off your estimations are, your main UI thread is not being blocked and remains responsive.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen