log4tango::TimeStamp(3)

πŸ“¦
version 9.3.4 Β· 2 versions
, in debian bookworm

🌸 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 a TimeStamp representing '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 a TimeStamp representing 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 the TimeStamp.
  • int get_milliseconds (void) const β€” returns the 'subseconds' part of the TimeStamp in milliseconds. the math is literally get_milliseconds() == get_microseconds() / 1000.
  • int get_microseconds (void) const β€” returns the subsecond part of the TimeStamp in 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 a TimeStamp representing 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