Panda3D
Public Member Functions | Static Public Member Functions | List of all members
ProfileTimer Class Reference

More...

Public Member Functions

 __init__ (const ProfileTimer other)
 
 __init__ (str name, int maxEntries)
 
 consolidateTo (Ostream out)
 
double getTotalTime ()
 Don't call any of the following during timing: (Because they are slow, not because anything will break). More...
 
 init (str name, int maxEntries)
 
 mark (str tag)
 
 off ()
 
 off (str tag)
 
 on ()
 
 printTo (Ostream out)
 

Static Public Member Functions

static consolidateAllTo (Ostream out)
 
static printAllTo (Ostream out)
 

Detailed Description

HowTo: Create a ProfileTimer and hold onto it. Call init() whenever you like (the timer doesn't start yet). Call on() to start the timer. While the timer is on, call mark() at each point of interest, in the code you are timing. You can turn the timer off() and on() to skip things you don't want to time. When your timing is finished, call printTo() to see the results (e.g. myTimer.printTo(cerr)).

Notes: You should be able to time things down to the millisecond well enough, but if you call on() and off() within micro- seconds of each other, I don't think you'll get very good results. */

Member Function Documentation

◆ __init__() [1/2]

__init__ ( const ProfileTimer  other)

◆ __init__() [2/2]

__init__ ( str  name,
int  maxEntries 
)

◆ consolidateAllTo()

static consolidateAllTo ( Ostream  out)
static

◆ consolidateTo()

consolidateTo ( Ostream  out)

◆ getTotalTime()

double getTotalTime ( )

Don't call any of the following during timing: (Because they are slow, not because anything will break).

◆ init()

init ( str  name,
int  maxEntries 
)

◆ mark()

mark ( str  tag)

◆ off() [1/2]

off ( )

◆ off() [2/2]

off ( str  tag)

◆ on()

on ( )

◆ printAllTo()

static printAllTo ( Ostream  out)
static

◆ printTo()

printTo ( Ostream  out)