Peano
Loading...
Searching...
No Matches
trace.h File Reference
#include <chrono>
#include <utility>
#include <lang/type.h>
Include dependency graph for trace.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define duration(a)   std::chrono::duration_cast<std::chrono::milliseconds>(a).count()
 
#define timeNow()   std::chrono::high_resolution_clock::now()
 
#define since(a)   duration(timeNow() - a)
 
#define TRACE(name, function_call)   TimeVar STRCAT(t, __LINE__) = timeNow(); function_call printf("%s : %ldms\n", name, since(STRCAT(t, __LINE__)));
 

Typedefs

typedef std::chrono::high_resolution_clock::time_point TimeVar
 

Macro Definition Documentation

◆ duration

#define duration ( a)    std::chrono::duration_cast<std::chrono::milliseconds>(a).count()

Definition at line 10 of file trace.h.

◆ since

#define since ( a)    duration(timeNow() - a)

Definition at line 12 of file trace.h.

◆ timeNow

#define timeNow ( )    std::chrono::high_resolution_clock::now()

Definition at line 11 of file trace.h.

◆ TRACE

#define TRACE ( name,
function_call )   TimeVar STRCAT(t, __LINE__) = timeNow(); function_call printf("%s : %ldms\n", name, since(STRCAT(t, __LINE__)));

Definition at line 15 of file trace.h.

Referenced by main().

Typedef Documentation

◆ TimeVar

typedef std::chrono::high_resolution_clock::time_point TimeVar

Definition at line 8 of file trace.h.