Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
profile.h File Reference
#include <unistd.h>
#include <sys/time.h>

Go to the source code of this file.

Macros

#define RESETTIME()   startTime()
 
#define REPORTTIME(comment)   endTime( comment, __FILE__, __LINE__ )
 

Functions

static void startTime ()
 
static void endTime (const char *comment, const char *file, int lineno)
 

Variables

static timeval start
 

Macro Definition Documentation

#define REPORTTIME (   comment)    endTime( comment, __FILE__, __LINE__ )

Definition at line 9 of file profile.h.

#define RESETTIME ( )    startTime()

Definition at line 8 of file profile.h.

Referenced by GameUniverse::StartDraw().

Function Documentation

static void endTime ( const char *  comment,
const char *  file,
int  lineno 
)
inlinestatic

Definition at line 17 of file profile.h.

References start.

18 {
19  timeval end;
20  gettimeofday( &end, NULL );
21  double time = end.tv_sec-start.tv_sec+(end.tv_usec-start.tv_usec)/1000000.0;
22  std::clog<<file<<"("<<comment<<"):"<<lineno<<": "<<time<<std::endl;
23 }
static void startTime ( )
inlinestatic

Definition at line 12 of file profile.h.

References start.

13 {
14  gettimeofday( &start, NULL );
15 }

Variable Documentation