mirror of
https://git.planet-casio.com/Lephenixnoir/libprof.git
synced 2024-12-26 19:43:41 +01:00
add non-recursive, faster versions of enter/leave
This commit is contained in:
parent
ac348bce34
commit
b6657c0834
1 changed files with 8 additions and 0 deletions
|
@ -66,6 +66,14 @@ extern uint32_t volatile *prof_tcnt;
|
|||
if(!--prof.rec) prof.elapsed -= *prof_tcnt; \
|
||||
}
|
||||
|
||||
/* Variant of prof_enter()/prof_leave() for non-recursive contexts */
|
||||
#define prof_enter_norec(prof) { \
|
||||
prof.elapsed += *prof_tcnt; \
|
||||
}
|
||||
#define prof_leave_norec(prof) { \
|
||||
prof.elapsed -= *prof_tcnt; \
|
||||
}
|
||||
|
||||
/* prof_exec(): Measure a single block of code
|
||||
This operation can be used when profiling is not required, and instead
|
||||
libprof is used to measure the performance of a single bit of code. Use it
|
||||
|
|
Loading…
Reference in a new issue