sc::Timer(3)
sc::Timer(3) π
okay bestie, welcome to the MPQC corner of the manual, the sc::Timer page, and honestly? she's giving β¨responsible little stopwatchβ¨ energy. no cap.
πΈ NAME πΈ
sc::Timer β so like, the Timer class uses RegionTimer to time intervals in an exception safe manner. periodt. π
β¨ SYNOPSIS β¨
#include <regtime.h>
π Public Member Functions π
Timer(const char *name)β starts timing a region using the defaultRegionTimerand activates the timer. iconic behavior.Timer(const Ref<RegionTimer> &, const char *name)β starts timing a region using the givenRegionTimer. choose your own adventure, bestie π¦~Timer()β stops timing a region, if it's active. she cleans up after herself, we love that.void reset(const char *=0)β stops timing the current region, if it's active. (hold that thought, there's more in the member function section π)
π Detailed Description π
so the Timer class uses RegionTimer to time intervals in an exception safe manner. fr fr, that's the whole vibe.
the way that this works: it will automatically call RegionTimer::enter when its constructor is called, and RegionTimer::exit when its destructor is called. no manual poking required, she just knows. π§
also, the reset member can also result in RegionTimer's enter and exit routines being called. so like, more than one path to the party. π
β οΈ okay this part is important, don't skip it: the programmer is responsible for making sure that timers are exited in the reverse of the order that they are entered. that's on you, bestie. stack discipline. LIFO. don't be chaotic about it π
π¦ Constructor & Destructor Documentation π¦
sc::Timer::Timer (const char * name)
starts timing a region using the default RegionTimer and activates the timer. π
and here's the little detail: if a null name pointer is given, then the timer will not be activated. so null = no timer, that's the rule. iykyk.
sc::Timer::Timer (const Ref< RegionTimer > &, const char * name)
starts timing a region using the given RegionTimer β like, the one you hand her. π«Ά
same caveat though: if a null name pointer is given, then the timer will not be activated. matching set, adorable.
π Member Function Documentation π
void sc::Timer::reset (const char * = 0)
stops timing the current region, if it's active. π
now for the branching logic, pay attention:
- if a new region name is passed in, she'll start timing with that name. new name, new era, main character energy π
- if no region name is given, the
Timerwill be deactivated. okay so she's actually just gonna sit this one out.
β Author β
generated automatically by Doxygen for MPQC from the source code. the robots did this one, not me πβ¨
okay that's the whole page, you ate that honestly π
π cute little sign-off for the road: this is Version 2.3.1, dated Sun Oct 4 2020, and it lives at sc::Timer(3). slay. ππ¦π
π¦ where this page comes from
- ubuntu jammy: libsc-doc 2.3.1-21
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms