Libraries: MQL Plus Enhanced Debugging Support - page 2

 
Dominik Christian Egert #:

Done. -Tested and published....

Please download current version and check to see if thats satisfying your requirements.

Great! Very comfortably!

#define LIB_PERF_PROFILING
#include <MQLplus/lib_debug.mqh> // https://www.mql5.com/en/code/32071

#define TimeIt PERF_COUNTER_TIMEIT_R
#define TimeItV PERF_COUNTER_TIMEIT_V

int f1() { Sleep(100); return(1); }
int f2() { Sleep(200); return(2); }
int f3() { Sleep(300); return(3); }

int g()
{
  return(TimeIt(f1() + f2() + f3() == 6) ?
                       TimeIt(f1() * f2()) : 0);
}

void OnStart()
{
  if (TimeIt(g()) == 2)   
    Print(TimeIt(f3() == 3));

  TimeItV(
  Print(f1());
  Print(f2());)  
}


Result.

f1()+f2()+f3()==6: Runtime: 615471 microseconds; average(615471), min(615471), max(615471); total calls: 1
f1()*f2(): Runtime: 325698 microseconds; average(325698), min(325698), max(325698); total calls: 1
g(): Runtime: 941306 microseconds; average(941976), min(0), max(942647); total calls: 2
f3()==3: Runtime: 313092 microseconds; average(311939), min(0), max(313092); total calls: 2
true
1
2
OnStart() @Line 22: Runtime: 314154 microseconds; average(314154), min(314154), max(314154); total calls: 1
If the parameter is "total calls=1", then it makes no sense to display average/min/max/totalcalls.
 
fxsaber #:

Great! Very comfortably!


Result.

If the parameter is "total calls=1", then it makes no sense to display average/min/max/totalcalls.

Welcome.

I see some errors and improvement possibilities.... 

 
Dominik Christian Egert #:

Welcome.

I see some errors and improvement possibilities.... 

I am impressed. Great job.
 

@Alain Verleyen Thank you....

@fxsaber Fixed and added.

In fact, I had an error in clearing the counters memory before usage. 

 
Dominik Christian Egert #:

@Alain Verleyen Thank you....

@fxsaber Fixed and added.

In fact, I had an error in clearing the counters memory before usage. 

I removed my picture, I hope you don't mind ;-)
 
Alain Verleyen #:
I removed my picture, I hope you don't mind ;-)
I don't.... :-)


 
Was I dreaming or you had a project in Shared Folders ? I can't find it. Or maybe I am confused with someone else ?
 
Dominik Christian Egert #:

@fxsaber Fixed and added.

When do you need a macro for objects?

PERF_COUNTER_TIMEIT_O
    //      PERF_COUNTER_TIMEIT_O notes are same as for PERF_COUNTER_TIMEIT_R, with 
    //      one addition: The Copy-Constructor of the returned object will be called 
    //      twice. The first call contributes to the measurement results, the second 
    //      consequently does not. In order to encapusalte the function calls, an 
    //      additional copy of the object is required within the process of returning 
    //      values from the function.
 
@Alain Verleyen #: Was I dreaming or you had a project in Shared Folders ? I can't find it. Or maybe I am confused with someone else ?

Yes, MQLplus is a shared public project!


 
Fernando Carreiro #:

Yes, MQLplus is a shared public project!


I guess, I have to update that.

My Storage drives me crazy, it rarely works...

I'll update the project now.


Reason: