timer_utils

moment_kinetics.timer_utils.format_global_timerMethod
format_global_timer(; show=true, truncate_output=true)

Manipulate a copy of the global_timer, to remove some things to reduce the clutter when it is printed.

By default the resulting TimerOutput is displayed in the terminal. Pass show_output=true to display the resulting TimerOutput in the terminal.

By default, the output is truncated, removing deeply nested timers and timers with very little time. To include all timers, pass truncate_output=false. The threshold for dropping timers is if their time is less than threshold times the total time.

By default, returns a string showing the contents of the TimerOutput. When show_output=true is passed, just returns the empty string.

source
moment_kinetics.timer_utils.timeit_debug_enabledMethod
timeit_debug_enabled()

@timeit_debug uses a function defined in the enclosing module called timeit_debug_enabled() to decide whether to include debug timers (included if this function returns true, or not - with zero overhead - if it returns false).

To control the debug timers in moment_kinetics we define this function once, in timer_utils, and import it from there into any other modules that use @timeit_debug.

To activate debug timers, edit this function so that it returns true.

source