sc::Timer(3)

πŸ“¦
version 2.3.1 Β· 4 versions
, in ubuntu jammy

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 default RegionTimer and activates the timer. iconic behavior.
  • Timer(const Ref<RegionTimer> &, const char *name) β€” starts timing a region using the given RegionTimer. 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 Timer will 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