ARX  1.0
The next-generation open source augmented reality toolkit.
Loading...
Searching...
No Matches
Macros | Functions | Variables
profile.c File Reference
#include <stdio.h>
#include <sys/time.h>
#include <ARX/ARUtil/profile.h>
Include dependency graph for profile.c:

Macros

#define LOG(...)   printf(__VA_ARGS__)
 
#define LOGe(...)   fprintf(stderr, __VA_ARGS__)
 

Functions

void profileClear (void)
 Reset profiling. More...
 
void profileSet (int n)
 Set profiling initial time and timing bucket, or add elapsed time to a bucket. More...
 
void profilePrint (void)
 Print all profiling buckets. More...
 

Variables

long profTable [MAX_PROF_NUM]
 
int profCount [MAX_PROF_NUM]
 

Macro Definition Documentation

◆ LOG

#define LOG (   ...)    printf(__VA_ARGS__)

◆ LOGe

#define LOGe (   ...)    fprintf(stderr, __VA_ARGS__)

Function Documentation

◆ profileClear()

void profileClear ( void  )

Reset profiling.

The profiling facility provides a single profile per process. There are up to MAX_PROF_NUM timing buckets available, numbered 0 to MAX_PROF_NUM-1. Call this function before the first call to profileSet to have the first call to profileSet function set the initial time and timing bucket.

See also
profileSet

◆ profilePrint()

void profilePrint ( void  )

Print all profiling buckets.

Prints all non-zero timing buckets and the percentage time occupied and total time.

◆ profileSet()

void profileSet ( int  n)

Set profiling initial time and timing bucket, or add elapsed time to a bucket.

This function sets a profiling timing point and selects the timing bucket. If being called for the first time, or the first time since profileClear was called, it sets the initial time, and subsequent calls will log time into the timing bucket n. On subsequent calls, the elapsed time since the last call will be added to the previously set timing bucket, and will again set the timing bucket.

Parameters
nThe timing bucket to add to on the next call.
See also
profileClear profilePrint

Variable Documentation

◆ profCount

int profCount[MAX_PROF_NUM]

◆ profTable

long profTable[MAX_PROF_NUM]