log4tango::TimeStamp(3)
πΈ log4tango::TimeStamp π
okay bestie, so this is a page from the log4tango manual β yes, the logging library, she's iconic β and today we're getting into TimeStamp, aka the little glow-up class that keeps track of when stuff happened. no cap, it's giving "clock but make it C++". let's get into it πβ¨
β¨ NAME β¨
log4tango::TimeStamp β the timestamp class, she's here, she's punctual, she's literally the moment. β°
π¦ SYNOPSIS π¦
first things first, you gotta let her in:
#include <TimeStamp.hh>
π Public Member Functions
TimeStamp ()β constructs aTimeStamprepresenting 'now'. like, right now. this exact second. main character energy fr.TimeStamp (const TimeStamp &t)β the Copy Constructor. a lil duplicate, a twin, a clone. π«ΆTimeStamp (unsigned int seconds, unsigned int microseconds=0)β constructs aTimeStamprepresenting the given offset since the epoch (00:00:00 1970/1/1 UTC). you hand her seconds, and optionally microseconds, and she's like "got it bestie".int get_seconds (void) constβ returns the'seconds'part of theTimeStamp.int get_milliseconds (void) constβ returns the'subseconds'part of theTimeStampin milliseconds. the math is literallyget_milliseconds() == get_microseconds() / 1000.int get_microseconds (void) constβ returns the subsecond part of theTimeStampin microseconds.void operator= (const TimeStamp &t)β Operator=. she assigns, she copies, she serves. π
π Static Public Member Functions
static const TimeStamp & get_start_time (void)β returns aTimeStamprepresenting the time at which the application started. the origin story. the big bang. π
πΈ Protected Attributes
int _secondsβ the seconds, protected, obviously.int _micro_secondsβ the microseconds, also protected, also obviously. π
π§ Static Protected Attributes
static TimeStamp _start_stampβ the static start stamp, protected, keeping the whole app's birthday on lock. β
π Constructor & Destructor Documentation π
log4tango::TimeStamp::TimeStamp ()
Constructs a TimeStamp representing 'now'. that's it, that's the vibe. the present moment, captured. π
log4tango::TimeStamp::TimeStamp (const TimeStamp & t) [inline]
Copy Constructor. she copies. she duplicates. slay. π
log4tango::TimeStamp::TimeStamp (unsigned int seconds, unsigned int microseconds = 0) [inline]
Constructs a TimeStamp representing the given offset since the epoch ( 00:00:00 1970/1/1 UTC ). bestie that's the dawn of Unix time, the literal beginning, and you're measuring from there. iconic. β¨
π₯ Member Function Documentation π₯
int log4tango::TimeStamp::get_microseconds (void) const [inline]
Returns the subsecond part of the TimeStamp in microseconds.
β οΈ real talk: the actual precision of this value depends on the platform and may be in the order of milliseconds rather than microseconds. so likeβ¦ she says microseconds but sometimes she's rounding, yk? don't come for her, it's the platform's fault. π
int log4tango::TimeStamp::get_milliseconds (void) const [inline]
Returns the 'subseconds' part of the TimeStamp in milliseconds, and the whole entire formula is:
get_milliseconds() == get_microseconds() / 1000
math ate, periodt. π
int log4tango::TimeStamp::get_seconds (void) const [inline]
Returns the 'seconds' part of the TimeStamp. simple. clean. no notes. π
static const TimeStamp & log4tango::TimeStamp::get_start_time (void) [inline], [static]
Returns a TimeStamp representing the time at which the application started. it's static and inline, and it remembers when everything began for you. nostalgic ngl π₯Ή
void log4tango::TimeStamp::operator= (const TimeStamp & t) [inline]
Operator=. the assignment. she becomes the other one. body swap but make it C++. π₯
π«Ά Member Data Documentation π«Ά
int log4tango::TimeStamp::_micro_seconds [protected]
the microsecond storage. protected so nobody outside the family touches her. π
int log4tango::TimeStamp::_seconds [protected]
the second storage. also protected. also sacred. π
TimeStamp log4tango::TimeStamp::_start_stamp [static], [protected]
the static, protected start stamp. the one that remembers the beginning of everything. β¨
π Author π
Generated automatically by Doxygen for log4tango from the source code. so like, not a human author, a robot author, and honestly? she ate. π€π
aaaand that's the whole page bestie, no cap, every flag and function accounted for π― β this was Version 5.0.2 of the log4tango man pages, dated Thu Dec 5 2024, and yes it really is filed under log4tango::TimeStamp(3). mwah, go timestamp something. ππ
β¨
π¦ where this page comes from
- debian bookworm: liblog4tango-doc 9.3.4+dfsg1-2+deb12u1 Β· LGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms