1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
9 #ifndef anna_time_functions_hpp
10 #define anna_time_functions_hpp
27 Initializes global data used on time module. It must be firstly invoked on this module
29 static void initialize() throw();
32 Initializes reference timestamp used for statistics purposes and neccessary on limited 32-bits architectures
33 in order to avoid overflow for unix timestamps. Time module initizalization timestamp remains if this is not called.
35 @param secondsTimestamp Reference timestamp in seconds. By default current is set.
37 static void setControlPoint(unsigned long long int secondsTimestamp = 0) throw();
40 Gets the seconds reference established by mean #setControlPoint
42 static unsigned long long int getSecondsReference() throw();
49 Gets initialization state
51 static bool initialized(void) throw();
54 Gets the host user-supplied timezone configuration
56 static const Timezone & getSystemTimezone(void) throw();
60 Get unix timestamp in seconds
62 static unsigned long long int unixSeconds() throw();
66 Get unix timestamp in milliseconds
68 static unsigned long long int unixMilliseconds() throw();
71 Get the lapsed milliseconds from the last control point (#setControlPoint) or time module initialization.
72 Used for statistics purposes (performance analysis), specially on 32-bits limited architectures in order
73 to avoid overflow on timestamp structures.
75 static unsigned long long int lapsedMilliseconds() throw();
78 Get unix timestamp in microseconds
80 static unsigned long long int unixMicroseconds() throw();
84 Get string time representation in format 'HH:mm:ss \<usecs\>'
85 Useful for trace accurated time for events.
87 static std::string currentTimeAsString(void) throw();