yt-project / libyt

In-situ analysis with yt
https://libyt.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
9 stars 3 forks source link

Add Timer #51

Closed cindytsai closed 2 years ago

cindytsai commented 2 years ago

Add Timer To Help Monitor Performance

Compile libyt with This Feature

Turn on SUPPORT_TIMER flag in Makefile:

# libyt/src/Makefile
# turn on the timer in each libyt substep.
#OPTIONS := -DSUPPORT_TIMER

This option is closed by default.

Set libyt Timer to Global

// include/yt_global.h
#ifdef SUPPORT_TIMER
#include "Timer.h"
SET_GLOBAL( Timer,         *g_timer,          NULL  );   // Timer for recording performance.
#endif // #ifdef SUPPORT_TIMER

Timer Class

View Result