U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Core » What`s the corect way to use TimingInspector?
Re: What`s the corect way to use TimingInspector? [message #36590 is a reply to message #36589] Wed, 13 June 2012 17:54 Go to previous messageGo to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1796
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi akebee

I'm not sure if I understand correctly what are you trying to achieve, but I think there might be a misunderstanding about how TimingInspector works. It is not just a simple stopwatch. It gathers multiple timings of repeated actions (the intervals between Start() and End() calls) and makes up some statistics at the end. The Dump() method is automatically called in destructor, so it dumps the results into the log (see Debug>View the logfile or press Alt+L in TheIDE). If you want to measure times of more than one distinct things, you have to create multiple Timing inspector instances.

Another thing is that TimingInspector is not usually used directly. There is a macro TIMING(label) which simplifies the measurements. The usage is simple, it just measures the times between the line where it is specified and end of current scope (that is till next '}'). E.g.:
#include <Core/Core.h>
using namespace Upp;

void DoSomething(){
    TIMING("timer_in_DoSomething");
    // do something here
}

CONSOLE_APP_MAIN{
    for(int i = 0; i<500; i++)
        DoSomething();
}


Note that timing works in Debug mode only, if you want to profile application build in Optimal mode, you can use RTIMING, the syntax and behavior is the same.

Hope that helps Smile

Best regards,
Honza
 
Read Message icon9.gif
Read Message
Read Message icon10.gif
Read Message
Read Message
Previous Topic: How to mark a class of function is deprecated
Next Topic: [Solved]XML Rpc client will halt when server is not running
Goto Forum:
  


Current Time: Sun Apr 26 09:06:40 GMT+2 2026

Total time taken to generate the page: 0.00933 seconds