2.2.7.8.1 Profiler::Profiler

Description

Default constructor to create a Profiler object.

Syntax

Profiler( int nDisplayNum = 10 )

Parameters

nDisplayNum
[input] Set to display the number of most time-cosuming functions.

Return

Examples

EX1

#include <origin.h>
#include <profiler.h>
void Profiler_ex1()
{
    Profiler tempObj(3); // Show top 3 most time consuming functions    
    vector vSrc;
    matrix mat;
    vSrc.SetSize(500000);
    mat.SetSize(500,1000);
    for(int n=0; n<500000; n++)
    {
    	vSrc[n] = (int)(rnd()*1000000);
    }
    mat.SetByVector(vSrc);
    vSrc.Sort();
    mat.Sort();
   
}
/*
Output:
Top 3 most time consuming functions:
Function Name                      Time(sec)	Num of Calls
<1>Profiler::Profiler              1.377900 	1
<2>Project::Profile                1.377777 	1
<3>vectorbase::Sort                0.254542 	1
*/

Remark

See Also

Header to Include

Profiler.h