|
CMSDK 2.0.1
Cross-platform C++ base library and SDK for the Psyclone AIOS platform
|
The CMSDK time layer: µs-resolution 64-bit timestamps, one shared timeline for every thread, process and machine in a Psyclone system. More...
The CMSDK time layer: µs-resolution 64-bit timestamps, one shared timeline for every thread, process and machine in a Psyclone system.
Classes | |
| struct | cmlabs::PsyDateAndTime |
| A PsyTime timestamp or time difference broken down into calendar fields. More... | |
Macros | |
| #define | USEC_YEAR_0_TO_1970 62167305600000000L |
| Microseconds between year 0000 and the Unix epoch (1970-01-01). | |
| #define | SECS_PER_YEAR 31536000 |
| Seconds in a (non-leap) 365-day year. | |
| #define | SECS_PER_MONTH 2629744 |
| Average seconds per Gregorian month (365.2425/12 days). | |
| #define | SECS_PER_WEEK 604800 |
| Seconds per week. | |
| #define | SECS_PER_DAY 86400 |
| Seconds per day. | |
| #define | SECS_PER_HOUR 3600 |
| Seconds per hour. | |
| #define | SECS_PER_MIN 60 |
| Seconds per minute. | |
| #define | TIME_YEAR_1970 62167305600000000L |
| Same value as USEC_YEAR_0_TO_1970: the PsyTime timestamp of 1970-01-01 00:00:00 UTC. | |
Functions | |
| uint64 | cmlabs::GetTimeNow () |
| Return the current absolute time (µs since year 0) according to the TMC. | |
| uint64 | cmlabs::SyncToHardwareClock () |
| Recompute the Time Mapping Constant by anchoring the monotonic clock to the wall clock. | |
| bool | cmlabs::SetCurrentNetSyncDif (int64 netTimeDif) |
| Set the network time difference for a slave node so its GetTimeNow() matches the master. | |
| bool | cmlabs::SetCurrentTimeSyncData (uint64 tmc, int64 netTimeAdjust) |
| Install externally computed sync data (e.g. | |
| bool | cmlabs::GetCurrentTimeSyncData (uint64 &tmc, int64 &netTimeAdjust) |
| Read the current sync data. | |
| uint64 | cmlabs::EstNextTMCWrap () |
| Estimate when the underlying hardware counter will next wrap around. | |
| int64 | cmlabs::GetTimeAge (uint64 t) |
| Age of a timestamp relative to now. | |
| int32 | cmlabs::GetTimeAgeMS (uint64 t) |
| Age of a timestamp relative to now, in milliseconds. | |
| uint64 | cmlabs::GetTimeFromString (const char *str) |
| Parse a textual date/time into a PsyTime timestamp. | |
| uint32 | cmlabs::GetHTTPTime (uint64 time, char *buffer, uint32 size) |
| Format a timestamp as an HTTP-date (RFC 7231) string, e.g. | |
| uint64 | cmlabs::GetTimeFromPsyDateAndTime (struct PsyDateAndTime &tad) |
| Convert a broken-down PsyDateAndTime back into a µs timestamp. | |
| uint32 | cmlabs::GetTimeOffsetGMT () |
| struct PsyDateAndTime | cmlabs::GetDateAndTime (uint64 t, bool local=true) |
| Break a timestamp into calendar fields. | |
| struct PsyDateAndTime | cmlabs::GetDateAndTimeUTC (uint64 t) |
| Break a timestamp into calendar fields in UTC. | |
| struct PsyDateAndTime | cmlabs::GetTimeDifference (uint64 t1, uint64 t2) |
| Express the difference t1 - t2 as calendar fields (negative flag set when t2 > t1). | |
| struct PsyDateAndTime | cmlabs::GetTimeDifference (int64 dif) |
| Express a signed µs difference as calendar fields. | |
| uint64 | cmlabs::FTime2PsyTime (uint64 t) |
| Convert an ftime-style value (ms since Unix epoch) to a PsyTime µs timestamp. | |
| bool | cmlabs::PsyTime_UnitTest () |
| Run the PsyTime unit tests. | |
Variables | |
| static char | cmlabs::PsyDays [][5] = {"None", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"} |
| Abbreviated weekday names indexed 1..7 (Mon..Sun); index 0 is "None". | |
| static char | cmlabs::PsyDaysFull [][10] = {"None", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"} |
| Full weekday names indexed 1..7 (Monday..Sunday); index 0 is "None". | |
| static char | cmlabs::PsyMonths [][5] = {"None", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"} |
| Abbreviated month names indexed 1..12 (Jan..Dec); index 0 is "None". | |
| static char | cmlabs::PsyMonthsFull [][10] = {"None", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"} |
| Full month names indexed 1..12; index 0 is "None". | |
| static uint64 | cmlabs::CurrentTMC = 0 |
| Current Time Mapping Constant (µs offset from monotonic clock to absolute PsyTime). | |
| static uint8 | cmlabs::CurrentTMCMode = TMC_MASTER |
| Current TMC role: TMC_MASTER or TMC_SLAVE. | |
| static uint64 | cmlabs::LastTMCSync = 0 |
| PsyTime timestamp of the last hardware-clock sync. | |
| static int64 | cmlabs::NetTimeAdjust = 0 |
| Signed network time adjustment (µs) applied when slaved to a remote master. | |
char* time formatters | |
Format timestamps into newly allocated char buffers.
| |
| char * | cmlabs::PrintTime (uint64 t, bool local=true, bool us=true, bool ms=true) |
| Full date + time-of-day. | |
| char * | cmlabs::PrintTimeOnly (uint64 t, bool local=true, bool us=true, bool ms=true) |
| Time-of-day only. | |
| char * | cmlabs::PrintTimeDif (uint64 t, bool us=true, bool ms=true) |
| Format a µs duration with scale-adaptive units: "250us", "1.500ms", "2.750s", "2m 3s", "01:02:03", "3 days 01:02:03". | |
| char * | cmlabs::PrintDate (uint64 t, bool local=true) |
| Date only, human-readable. | |
| char * | cmlabs::PrintDateSortable (uint64 t, bool local=true) |
| Date only, sortable (e.g. | |
| char * | cmlabs::PrintDateSortableDelimiter (uint64 t, const char *del, bool local=true) |
| Sortable date with custom field delimiter. | |
| char * | cmlabs::PrintTimeSortable (uint64 t, bool local) |
| Sortable date+time, second resolution. | |
| char * | cmlabs::PrintTimeSortableMillisec (uint64 t, bool local) |
| Sortable date+time with milliseconds. | |
| char * | cmlabs::PrintTimeSortableMicrosec (uint64 t, bool local) |
| Sortable date+time with microseconds. | |
std::string time formatters | |
Thread-safe, leak-free equivalents of the char* formatters above (they wrap the char* variants and free the buffer); same parameter conventions (t µs timestamp, local, us, ms). Preferred in application code. uint64 t = GetTimeNow();
std::string full = PrintTimeString(t); // "21/07/2026 15:30:02.123.456"
std::string sortable = PrintTimeSortableMillisecString(t); // "20260721-153002.123"
std::string PrintTimeOnlyString(uint64 t, bool local=true, bool us=true, bool ms=true) Definition PsyTime.cpp:685 | |
| std::string | cmlabs::PrintTimeNowString (bool local=true, bool us=true, bool ms=true) |
| Format GetTimeNow(). | |
| std::string | cmlabs::PrintTimeString (uint64 t, bool local=true, bool us=true, bool ms=true) |
| std::string | cmlabs::PrintTimeOnlyString (uint64 t, bool local=true, bool us=true, bool ms=true) |
| std::string | cmlabs::PrintTimeDifString (uint64 t, bool us=true, bool ms=true) |
| std::string | cmlabs::PrintDateString (uint64 t, bool local=true) |
| std::string | cmlabs::PrintDateStringSortable (uint64 t, bool local=true) |
| std::string | cmlabs::PrintDateStringSortableDelimiter (uint64 t, const char *del, bool local=true) |
| std::string | cmlabs::PrintTimeSortableString (uint64 t, bool local=true) |
| Sortable date+time, second resolution. | |
| std::string | cmlabs::PrintTimeSortableMillisecString (uint64 t, bool local=true) |
| Sortable date+time with milliseconds. | |
| std::string | cmlabs::PrintTimeSortableMicrosecString (uint64 t, bool local=true) |
| Sortable date+time with microseconds. | |
Millisecond duration constants | |
Common durations expressed in milliseconds.
| |
| #define | SECOND_MS 1000 |
| #define | MINUTE_MS SECS_PER_MIN * 1000 |
| #define | HOUR_MS SECS_PER_HOUR * 1000 |
| #define | DAY_MS SECS_PER_DAY * 1000 |
| #define | WEEK_MS SECS_PER_WEEK * 1000 |
| #define | MONTH_MS (uint64)SECS_PER_MONTH * 1000 |
| #define | YEAR_MS (uint64)SECS_PER_YEAR * 1000 |
Microsecond duration constants | |
Common durations expressed in microseconds — the native PsyTime unit. | |
| #define | SECOND_US (uint64)1000000 |
| #define | MINUTE_US (uint64)SECS_PER_MIN * 1000000 |
| #define | HOUR_US (uint64)SECS_PER_HOUR * 1000000 |
| #define | DAY_US (uint64)SECS_PER_DAY * 1000000 |
| #define | WEEK_US (uint64)SECS_PER_WEEK * 1000000 |
| #define | MONTH_US (uint64)SECS_PER_MONTH * 1000000 |
| #define | YEAR_US (uint64)SECS_PER_YEAR * 1000000 |
PSY* duration aliases | |
Preferred spelling of the µs duration constants in application code, e.g. 5*PSYSECOND. | |
| #define | PSYSECOND SECOND_US |
| #define | PSYMINUTE MINUTE_US |
| #define | PSYHOUR HOUR_US |
| #define | PSYDAY DAY_US |
| #define | PSYWEEK WEEK_US |
| #define | PSYMONTH MONTH_US |
| #define | PSYYEAR YEAR_US |
TMC roles and sync interval | |
| #define | TMC_MASTER 0 |
| This node is the time master; others sync to it. | |
| #define | TMC_SLAVE 1 |
| This node slaves its clock to a remote master. | |
| #define | TMC_SYNC_INTERVAL 60000000 |
| Re-sync interval in µs (1 minute). | |
| #define DAY_MS SECS_PER_DAY * 1000 |
| #define DAY_US (uint64)SECS_PER_DAY * 1000000 |
| #define HOUR_MS SECS_PER_HOUR * 1000 |
| #define HOUR_US (uint64)SECS_PER_HOUR * 1000000 |
| #define MINUTE_MS SECS_PER_MIN * 1000 |
| #define MINUTE_US (uint64)SECS_PER_MIN * 1000000 |
| #define MONTH_MS (uint64)SECS_PER_MONTH * 1000 |
| #define MONTH_US (uint64)SECS_PER_MONTH * 1000000 |
| #define PSYMINUTE MINUTE_US |
Definition at line 125 of file PsyTime.h.
Referenced by cmlabs::MessageIndex::MessageIndex().
| #define SECS_PER_DAY 86400 |
Seconds per day.
Definition at line 90 of file PsyTime.h.
Referenced by cmlabs::GetTimeDifference(), and cmlabs::PrintTimeDif().
| #define SECS_PER_HOUR 3600 |
Seconds per hour.
Definition at line 91 of file PsyTime.h.
Referenced by cmlabs::GetDateAndTime(), cmlabs::GetTimeDifference(), and cmlabs::PrintTimeDif().
| #define SECS_PER_MIN 60 |
Seconds per minute.
Definition at line 92 of file PsyTime.h.
Referenced by cmlabs::GetTimeDifference().
| #define SECS_PER_MONTH 2629744 |
Average seconds per Gregorian month (365.2425/12 days).
Definition at line 88 of file PsyTime.h.
Referenced by cmlabs::GetTimeDifference().
| #define SECS_PER_YEAR 31536000 |
Seconds in a (non-leap) 365-day year.
Definition at line 86 of file PsyTime.h.
Referenced by cmlabs::GetTimeDifference().
| #define TIME_YEAR_1970 62167305600000000L |
Same value as USEC_YEAR_0_TO_1970: the PsyTime timestamp of 1970-01-01 00:00:00 UTC.
Definition at line 94 of file PsyTime.h.
Referenced by cmlabs::HTTPRequest::createMultipartRequest(), cmlabs::HTTPRequest::createRequest(), cmlabs::HTTPRequest::createRequest(), and cmlabs::HTTPRequest::createRequest().
| #define TMC_MASTER 0 |
This node is the time master; others sync to it.
Definition at line 217 of file PsyTime.h.
Referenced by cmlabs::GetTimeNow().
| #define TMC_SLAVE 1 |
This node slaves its clock to a remote master.
Definition at line 218 of file PsyTime.h.
Referenced by cmlabs::SetCurrentTimeSyncData().
| #define TMC_SYNC_INTERVAL 60000000 |
Re-sync interval in µs (1 minute).
Definition at line 219 of file PsyTime.h.
Referenced by cmlabs::GetTimeNow().
| #define USEC_YEAR_0_TO_1970 62167305600000000L |
Microseconds between year 0000 and the Unix epoch (1970-01-01).
Subtract to convert PsyTime → Unix µs.
Definition at line 84 of file PsyTime.h.
Referenced by cmlabs::FTime2PsyTime(), cmlabs::GetDateAndTime(), cmlabs::GetTimeFromPsyDateAndTime(), and cmlabs::SyncToHardwareClock().
| #define WEEK_MS SECS_PER_WEEK * 1000 |
| #define WEEK_US (uint64)SECS_PER_WEEK * 1000000 |
| #define YEAR_MS (uint64)SECS_PER_YEAR * 1000 |
| #define YEAR_US (uint64)SECS_PER_YEAR * 1000000 |
| uint64 cmlabs::EstNextTMCWrap | ( | ) |
Estimate when the underlying hardware counter will next wrap around.
Definition at line 289 of file PsyTime.cpp.
Referenced by _wrap_EstNextTMCWrap(), _wrap_EstNextTMCWrap(), and Java_com_cmlabs_cmsdk_cmsdkJNI_EstNextTMCWrap().
| uint64 cmlabs::FTime2PsyTime | ( | uint64 | t | ) |
Convert an ftime-style value (ms since Unix epoch) to a PsyTime µs timestamp.
| t | Milliseconds since 1970-01-01. |
Definition at line 758 of file PsyTime.cpp.
References USEC_YEAR_0_TO_1970.
Referenced by _wrap_FTime2PsyTime(), _wrap_FTime2PsyTime(), cmlabs::utils::GetFileDetails(), and Java_com_cmlabs_cmsdk_cmsdkJNI_FTime2PsyTime().
| bool cmlabs::GetCurrentTimeSyncData | ( | uint64 & | tmc, |
| int64 & | netTimeAdjust ) |
Read the current sync data.
| tmc | Receives the current Time Mapping Constant. |
| netTimeAdjust | Receives the current network adjustment in µs. |
Definition at line 147 of file PsyTime.cpp.
References CurrentTMC, and NetTimeAdjust.
Referenced by _wrap_GetCurrentTimeSyncData(), _wrap_GetCurrentTimeSyncData(), and Java_com_cmlabs_cmsdk_cmsdkJNI_GetCurrentTimeSyncData().
| struct PsyDateAndTime cmlabs::GetDateAndTime | ( | uint64 | t, |
| bool | local = true ) |
Break a timestamp into calendar fields.
| t | Timestamp in µs since year 0. |
| local | true for local time (applies timezone/DST), false for UTC. |
Definition at line 324 of file PsyTime.cpp.
References cmlabs::PsyDateAndTime::day, cmlabs::PsyDateAndTime::dst, cmlabs::PsyDateAndTime::dstsec, GetDateAndTime(), cmlabs::PsyDateAndTime::hour, cmlabs::PsyDateAndTime::min, cmlabs::PsyDateAndTime::mon, cmlabs::PsyDateAndTime::msec, cmlabs::PsyDateAndTime::sec, SECS_PER_HOUR, cmlabs::utils::strcpyavail(), cmlabs::PsyDateAndTime::tzsec, cmlabs::PsyDateAndTime::usec, USEC_YEAR_0_TO_1970, cmlabs::PsyDateAndTime::wday, cmlabs::PsyDateAndTime::yday, cmlabs::PsyDateAndTime::year, and cmlabs::PsyDateAndTime::zonename.
Referenced by _wrap_GetDateAndTime__SWIG_0(), _wrap_GetDateAndTime__SWIG_0(), _wrap_GetDateAndTime__SWIG_1(), _wrap_GetDateAndTime__SWIG_1(), GetDateAndTime(), GetDateAndTimeUTC(), GetHTTPTime(), Java_com_cmlabs_cmsdk_cmsdkJNI_GetDateAndTime_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_GetDateAndTime_1_1SWIG_11(), PrintDate(), PrintDateSortable(), PrintDateSortableDelimiter(), PrintTime(), PrintTimeOnly(), PrintTimeSortable(), PrintTimeSortableMicrosec(), PrintTimeSortableMillisec(), and PsyTime_UnitTest().
| struct PsyDateAndTime cmlabs::GetDateAndTimeUTC | ( | uint64 | t | ) |
Break a timestamp into calendar fields in UTC.
| t | Timestamp in µs. |
Definition at line 312 of file PsyTime.cpp.
References GetDateAndTime(), and GetDateAndTimeUTC().
Referenced by _wrap_GetDateAndTimeUTC(), _wrap_GetDateAndTimeUTC(), GetDateAndTimeUTC(), and Java_com_cmlabs_cmsdk_cmsdkJNI_GetDateAndTimeUTC().
| uint32 cmlabs::GetHTTPTime | ( | uint64 | time, |
| char * | buffer, | ||
| uint32 | size ) |
Format a timestamp as an HTTP-date (RFC 7231) string, e.g.
for HTTP headers.
| time | Timestamp to format. |
| buffer | Destination buffer. |
| size | Size of buffer in bytes. |
Definition at line 518 of file PsyTime.cpp.
References cmlabs::PsyDateAndTime::day, GetDateAndTime(), cmlabs::PsyDateAndTime::hour, cmlabs::PsyDateAndTime::min, cmlabs::PsyDateAndTime::mon, PsyDays, PsyMonths, cmlabs::PsyDateAndTime::sec, cmlabs::PsyDateAndTime::wday, and cmlabs::PsyDateAndTime::year.
Referenced by _wrap_GetHTTPTime(), _wrap_GetHTTPTime(), cmlabs::HTTPReply::createAuthorizationReply(), cmlabs::HTTPReply::createErrorPage(), cmlabs::HTTPRequest::createMultipartRequest(), cmlabs::HTTPReply::createOptionsResponse(), cmlabs::HTTPReply::createPage(), cmlabs::HTTPRequest::createRequest(), cmlabs::HTTPRequest::createRequest(), cmlabs::HTTPRequest::createRequest(), and Java_com_cmlabs_cmsdk_cmsdkJNI_GetHTTPTime().
| int64 cmlabs::GetTimeAge | ( | uint64 | t | ) |
Age of a timestamp relative to now.
| t | Timestamp to compare (0 returns 0). |
Definition at line 25 of file PsyTime.cpp.
References GetTimeNow().
Referenced by _wrap_GetTimeAge(), _wrap_GetTimeAge(), cmlabs::RequestGateway::callInternalAPI(), cmlabs::MemoryManager::create(), cmlabs::RandomPathGenerator::generateNextPoint(), Internal_MessageScript(), Internal_Ping(), Internal_Print(), Internal_SignalPing(), Java_com_cmlabs_cmsdk_cmsdkJNI_GetTimeAge(), cmlabs::ProcessMemory::PerfTest(), cmlabs::PsyAPI::postOutputMessage(), cmlabs::NetworkConnection::readIntoBuffer(), cmlabs::NetworkConnection::receive(), cmlabs::SSLConnection::receive(), cmlabs::RequestGateway::receiveHTTPRequest(), cmlabs::RequestGateway::replyToClient(), cmlabs::RequestGateway::runExec(), cmlabs::SSLConnection::send(), cmlabs::TCPConnection::send(), cmlabs::UDPConnection::send(), cmlabs::ThreadManager::threadMonitoring(), cmlabs::MovingAverage::UnitTest(), cmlabs::ProcessMemory::UnitTest(), and cmlabs::TemporalMemory::UnitTest().
| int32 cmlabs::GetTimeAgeMS | ( | uint64 | t | ) |
Age of a timestamp relative to now, in milliseconds.
| t | Timestamp to compare (0 returns 0). |
Definition at line 35 of file PsyTime.cpp.
References GetTimeNow().
Referenced by _wrap_GetTimeAgeMS(), _wrap_GetTimeAgeMS(), cmlabs::MessageIndex::addMessage(), cmlabs::RequestGateway::addRequestReplyToRequestQueue(), cmlabs::ProcessMemory::checkProcessHeartbeats(), cmlabs::MemoryManager::connect(), cmlabs::NetworkChannel::ConnectionAutodetectRun(), cmlabs::MemoryManager::create(), Internal_BitmapPoster(), Internal_MessageScript(), Internal_QueryTest(), Internal_RetrieveTest(), cmlabs::PsySpace::isConnected(), Java_com_cmlabs_cmsdk_cmsdkJNI_GetTimeAgeMS(), cmlabs::TestRequestExecutor::longRequestRun(), cmlabs::MessageIndex::queryMessages(), cmlabs::NetworkConnection::receive(), cmlabs::SSLConnection::receive(), cmlabs::NetworkConnection::receiveAvailable(), cmlabs::HTTPProtocol::ReceiveHTTPReply(), cmlabs::HTTPProtocol::ReceiveHTTPRequest(), cmlabs::TelnetProtocol::ReceiveTelnetLine(), cmlabs::HTTPProtocol::ReceiveWebsocketData(), cmlabs::RequestQueue::removeStaleRequests(), cmlabs::VantagePoints::reserveNextPoint(), cmlabs::RequestClient::run(), cmlabs::RequestExecutor::run(), cmlabs::TestRequestClient::run(), cmlabs::TestWebRequestClient::run(), cmlabs::TestWebSocketRequestClient::run(), cmlabs::RequestGateway::runClient(), cmlabs::RequestGateway::runExec(), cmlabs::utils::RunOSCommand(), cmlabs::TCPConnection::send(), cmlabs::UDPConnection::send(), cmlabs::ThreadManager::shutdown(), cmlabs::ThreadManager::terminateThread(), cmlabs::RequestQueue::toJSON(), cmlabs::RequestQueue::toXML(), cmlabs::NetworkManager::UnitTest(), cmlabs::RequestGateway::UnitTest(), cmlabs::RequestClient::waitForConnection(), cmlabs::NetworkChannel::waitForHTTPReply(), cmlabs::NetworkChannel::waitForHTTPRequest(), cmlabs::NetworkChannel::waitForMessage(), cmlabs::NetworkChannel::waitForNetworkEvent(), cmlabs::utils::WaitForProcess(), cmlabs::DataMapsMemory::waitForRequestReply(), cmlabs::MemoryRequestConnection::waitForRequestReply(), cmlabs::NetworkChannel::waitForTelnetLine(), cmlabs::utils::Timer::waitForTimer(), and cmlabs::NetworkChannel::waitForWebsocketData().
| struct PsyDateAndTime cmlabs::GetTimeDifference | ( | int64 | dif | ) |
Express a signed µs difference as calendar fields.
| dif | Difference in µs. |
Definition at line 408 of file PsyTime.cpp.
References cmlabs::PsyDateAndTime::day, GetTimeDifference(), cmlabs::PsyDateAndTime::hour, cmlabs::PsyDateAndTime::min, cmlabs::PsyDateAndTime::mon, cmlabs::PsyDateAndTime::msec, cmlabs::PsyDateAndTime::negative, cmlabs::PsyDateAndTime::sec, SECS_PER_DAY, SECS_PER_HOUR, SECS_PER_MIN, SECS_PER_MONTH, SECS_PER_YEAR, cmlabs::PsyDateAndTime::usec, cmlabs::PsyDateAndTime::yday, and cmlabs::PsyDateAndTime::year.
| struct PsyDateAndTime cmlabs::GetTimeDifference | ( | uint64 | t1, |
| uint64 | t2 ) |
Express the difference t1 - t2 as calendar fields (negative flag set when t2 > t1).
| t1 | First timestamp. |
| t2 | Second timestamp. |
Definition at line 393 of file PsyTime.cpp.
References GetTimeDifference().
Referenced by _wrap_GetTimeDifference__SWIG_0(), _wrap_GetTimeDifference__SWIG_0(), _wrap_GetTimeDifference__SWIG_1(), _wrap_GetTimeDifference__SWIG_1(), GetTimeDifference(), GetTimeDifference(), Java_com_cmlabs_cmsdk_cmsdkJNI_GetTimeDifference_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_GetTimeDifference_1_1SWIG_11(), PrintTimeDif(), and PsyTime_UnitTest().
| uint64 cmlabs::GetTimeFromPsyDateAndTime | ( | struct PsyDateAndTime & | tad | ) |
Convert a broken-down PsyDateAndTime back into a µs timestamp.
| tad | Broken-down date/time (fields as documented in PsyDateAndTime). |
Definition at line 376 of file PsyTime.cpp.
References cmlabs::PsyDateAndTime::day, cmlabs::PsyDateAndTime::hour, cmlabs::PsyDateAndTime::min, cmlabs::PsyDateAndTime::mon, cmlabs::PsyDateAndTime::sec, USEC_YEAR_0_TO_1970, and cmlabs::PsyDateAndTime::year.
Referenced by _wrap_GetTimeFromPsyDateAndTime(), _wrap_GetTimeFromPsyDateAndTime(), GetTimeFromString(), and Java_com_cmlabs_cmsdk_cmsdkJNI_GetTimeFromPsyDateAndTime().
| uint64 cmlabs::GetTimeFromString | ( | const char * | str | ) |
Parse a textual date/time into a PsyTime timestamp.
Accepted formats (tried in order): RFC 822/1123 ("Sun, 06 Nov 1994 08:49:37 GMT"), RFC 850 ("Sunday, 06-Nov-94 08:49:37 GMT"), ANSI C asctime() ("Sun Nov 6 08:49:37 1994"), and the sortable forms produced by the PrintTimeSortable* functions ("YYYYMMDD-HHMMSS[.mmm[.uuu]]") — sortable input is interpreted as GMT.
| str | Date/time string. |
Definition at line 438 of file PsyTime.cpp.
References cmlabs::PsyDateAndTime::day, GetTimeFromPsyDateAndTime(), cmlabs::PsyDateAndTime::hour, cmlabs::PsyDateAndTime::min, cmlabs::PsyDateAndTime::mon, cmlabs::PsyDateAndTime::msec, PsyMonths, PsyMonthsFull, cmlabs::PsyDateAndTime::sec, cmlabs::utils::strcpyavail(), stricmp, cmlabs::PsyDateAndTime::usec, and cmlabs::PsyDateAndTime::year.
Referenced by _wrap_GetTimeFromString(), _wrap_GetTimeFromString(), Java_com_cmlabs_cmsdk_cmsdkJNI_GetTimeFromString(), cmlabs::HTTPReply::processHeader(), and cmlabs::HTTPRequest::processHeader().
| uint64 cmlabs::GetTimeNow | ( | ) |
Return the current absolute time (µs since year 0) according to the TMC.
Reads the platform monotonic clock (QueryPerformanceCounter on Windows, CLOCK_MONOTONIC on POSIX) and adds CurrentTMC plus any network adjustment.
Because timestamps are plain uint64 microseconds, time arithmetic is ordinary integer arithmetic using the PSY* duration constants:
Definition at line 69 of file PsyTime.cpp.
References CurrentTMC, CurrentTMCMode, LastTMCSync, NetTimeAdjust, SyncToHardwareClock(), TMC_MASTER, and TMC_SYNC_INTERVAL.
Referenced by _wrap_GetTimeNow(), _wrap_GetTimeNow(), cmlabs::TCPListener::acceptConnection(), cmlabs::RequestGateway::addAuthUser(), cmlabs::ComponentData::AddComponentStats(), cmlabs::ComponentMemory::addComponentStats(), cmlabs::ThreadManager::addLocalThreadStats(), cmlabs::MemoryRequestQueues::AddNewRequest(), cmlabs::utils::Timer::addTimer(), cmlabs::ProcessMemory::addToProcessStats(), Base64_UnitTest(), cmlabs::RequestGateway::callExternalAPI(), cmlabs::RequestGateway::callInternalAPI(), cmlabs::MemoryRequestConnection::connect(), cmlabs::NetworkChannel::ConnectionAutodetectRun(), cmlabs::ControlMessage::ControlMessage(), cmlabs::JSONM::convertToMessage(), cmlabs::ComponentMemory::create(), cmlabs::MasterMemory::create(), cmlabs::MemoryManager::create(), cmlabs::ProcessMemory::create(), cmlabs::TemporalMemory::create(), cmlabs::ComponentData::CreateComponent(), cmlabs::ComponentMemory::createComponent(), cmlabs::utils::CreateDrumBeat(), cmlabs::GenericMemoryMap< T, ID >::CreateEntry(), cmlabs::GenericMemoryMap< T, ID >::CreateFirstFreeEntry(), cmlabs::HTTPReply::createFromFile(), cmlabs::ProcessMemory::createNewProcess(), cmlabs::DataMapsMemory::createNewRequest(), cmlabs::ThreadManager::createThread(), cmlabs::DataMessage::DataMessage(), cmlabs::DataMessage::DataMessage(), cmlabs::DataMessage::DataMessage(), cmlabs::DataMessage::DataMessage(), cmlabs::MessageIndex::doMaintenance(), cmlabs::NetworkChannel::enterNetworkEvent(), cmlabs::RandomPathGenerator::generateNextPoint(), cmlabs::GenericObservation< T >::GenericObservation(), cmlabs::GenericObservation< T >::GenericObservation(), cmlabs::utils::GetFileDetails(), cmlabs::utils::TimeQueue< T >::getNextEntryDue(), cmlabs::MovingAverage::getPerfJSON(), cmlabs::MovingAverage::getPerfXML(), GetTimeAge(), GetTimeAgeMS(), Hash_UnitTest(), cmlabs::html::HTML_UnitTest(), cmlabs::HTTPReply::HTTPReply(), cmlabs::HTTPRequest::HTTPRequest(), cmlabs::MemoryRequestServer::init(), cmlabs::VantagePoints::init(), cmlabs::MemoryRequestQueues::InitQueue(), cmlabs::MemoryRequestQueues::InitRequestMap(), cmlabs::TemporalMemory::insertMessage(), Internal_BitmapPoster(), Internal_MessageScript(), Internal_Ping(), Internal_QueryTest(), Internal_RetrieveTest(), Internal_SignalPing(), Internal_SignalPong(), Internal_StatsLog(), Internal_Time(), Java_com_cmlabs_cmsdk_cmsdkJNI_GetTimeNow(), cmlabs::PsyAPI::logPrint(), cmlabs::LogSystem::LogSystemDebug(), cmlabs::LogSystem::LogSystemPrint(), cmlabs::TestRequestExecutor::longRequestRun(), cmlabs::TemporalMemory::maintenance(), MathClasses_UnitTest(), cmlabs::NetworkChannel::MessageConnectionRun(), cmlabs::MessageIndex::MessageIndex(), cmlabs::MessagePlayer::MessagePlayer(), NetworkProtocols_UnitTest(), NetworkTest_TCPClient(), cmlabs::ProcessMemory::PerfTest(), cmlabs::PsyAPI::postOutputMessage(), PrintTimeNowString(), cmlabs::HTTPRequest::processContent(), cmlabs::WebsocketData::processContent(), cmlabs::HTTPRequest::processHeader(), cmlabs::WebsocketData::processHeader(), cmlabs::PsySpace::PsySpace(), PsyTime_UnitTest(), cmlabs::NetworkConnection::readIntoBuffer(), cmlabs::NetworkConnection::receive(), cmlabs::SSLConnection::receive(), cmlabs::NetworkConnection::receiveAvailable(), cmlabs::SSLConnection::receiveAvailable(), cmlabs::HTTPProtocol::ReceiveHTTPReply(), cmlabs::HTTPProtocol::ReceiveHTTPRequest(), cmlabs::HTTPTestServer::receiveHTTPRequest(), cmlabs::RequestGateway::receiveHTTPRequest(), cmlabs::RequestExecutor::receiveMessage(), cmlabs::RequestGateway::receiveMessage(), cmlabs::RequestClient::receiveNetworkEvent(), cmlabs::RequestExecutor::receiveNetworkEvent(), cmlabs::RequestGateway::receiveNetworkEvent(), cmlabs::TelnetProtocol::ReceiveTelnetLine(), cmlabs::HTTPProtocol::ReceiveWebsocketData(), cmlabs::RequestGateway::receiveWebsocketData(), cmlabs::RequestGateway::replyToClient(), cmlabs::RequestReply::replyToRequest(), cmlabs::RequestGateway::RequestGateway(), cmlabs::RequestReply::RequestReply(), cmlabs::VantagePoints::reserveNextPoint(), cmlabs::RequestClient::run(), cmlabs::TestRequestClient::run(), cmlabs::TestWebRequestClient::run(), cmlabs::TestWebSocketRequestClient::run(), cmlabs::RequestGateway::runClient(), cmlabs::RequestGateway::runExec(), cmlabs::utils::RunOSCommand(), cmlabs::utils::SeedRandomValues(), cmlabs::SSLConnection::send(), cmlabs::TCPConnection::send(), cmlabs::UDPConnection::send(), cmlabs::RequestClient::sendMessageToGateway(), cmlabs::RequestExecutor::sendMessageToGateway(), cmlabs::RequestClient::sendRequest(), cmlabs::RequestExecutor::sendStatusNow(), cmlabs::ProcessMemory::setProcessStatus(), cmlabs::DataMapsMemory::setRequestStatus(), cmlabs::DataMapsMemory::setRequestStatus(), cmlabs::RandomPathGenerator::setStartPoint(), cmlabs::PsycloneIndex::setStatus(), cmlabs::ThreadManager::shutdown(), cmlabs::TelnetLine::TelnetLine(), cmlabs::ThreadManager::terminateThread(), Test_RequestClient(), cmlabs::ThreadManager::threadMonitoring(), cmlabs::utils::Timer::triggerTimer(), cmlabs::Bitmap::UnitTest(), cmlabs::ControlMessage::UnitTest(), cmlabs::MemoryManager::UnitTest(), cmlabs::MemoryRequestServer::UnitTest(), cmlabs::MessageIndex::UnitTest(), cmlabs::MovingAverage::UnitTest(), cmlabs::NetworkManager::UnitTest(), cmlabs::ProcessMemory::UnitTest(), cmlabs::RequestGateway::UnitTest(), cmlabs::RequestQueue::UnitTest(), cmlabs::RESTParser::UnitTest(), cmlabs::TemporalMemory::UnitTest(), cmlabs::ThreadManager::UnitTest(), cmlabs::TriggerSpec::UnitTest(), cmlabs::VantagePoints::UnitTest(), cmlabs::utils::UnitTest_Timer(), cmlabs::NetworkManager::UnitTestHTTP(), cmlabs::RequestClient::waitForConnection(), cmlabs::NetworkChannel::waitForHTTPReply(), cmlabs::NetworkChannel::waitForHTTPRequest(), cmlabs::RequestExecutor::waitForLongRequest(), cmlabs::NetworkChannel::waitForMessage(), cmlabs::NetworkChannel::waitForNetworkEvent(), cmlabs::PsyAPI::waitForNewMessage(), cmlabs::MessagePlayer::waitForNextMessage(), cmlabs::utils::WaitForProcess(), cmlabs::DataMapsMemory::waitForRequestReply(), cmlabs::MemoryRequestConnection::waitForRequestReply(), cmlabs::RequestExecutor::waitForShortRequest(), cmlabs::NetworkChannel::waitForTelnetLine(), cmlabs::utils::Timer::waitForTimer(), and cmlabs::NetworkChannel::waitForWebsocketData().
| uint32 cmlabs::GetTimeOffsetGMT | ( | ) |
Definition at line 397 of file PsyTime.cpp.
Referenced by _wrap_GetTimeOffsetGMT(), _wrap_GetTimeOffsetGMT(), and Java_com_cmlabs_cmsdk_cmsdkJNI_GetTimeOffsetGMT().
| char * cmlabs::PrintDate | ( | uint64 | t, |
| bool | local = true ) |
Date only, human-readable.
Definition at line 551 of file PsyTime.cpp.
References cmlabs::PsyDateAndTime::day, GetDateAndTime(), cmlabs::PsyDateAndTime::mon, and cmlabs::PsyDateAndTime::year.
Referenced by _wrap_PrintDate__SWIG_0(), _wrap_PrintDate__SWIG_0(), _wrap_PrintDate__SWIG_1(), _wrap_PrintDate__SWIG_1(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintDate_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintDate_1_1SWIG_11(), and PrintDateString().
| char * cmlabs::PrintDateSortable | ( | uint64 | t, |
| bool | local = true ) |
Date only, sortable (e.g.
YYYY-MM-DD).
Definition at line 579 of file PsyTime.cpp.
References cmlabs::PsyDateAndTime::day, GetDateAndTime(), cmlabs::PsyDateAndTime::mon, and cmlabs::PsyDateAndTime::year.
Referenced by _wrap_PrintDateSortable__SWIG_0(), _wrap_PrintDateSortable__SWIG_0(), _wrap_PrintDateSortable__SWIG_1(), _wrap_PrintDateSortable__SWIG_1(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintDateSortable_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintDateSortable_1_1SWIG_11(), and PrintDateStringSortable().
| char * cmlabs::PrintDateSortableDelimiter | ( | uint64 | t, |
| const char * | del, | ||
| bool | local = true ) |
Sortable date with custom field delimiter.
Definition at line 586 of file PsyTime.cpp.
References cmlabs::PsyDateAndTime::day, GetDateAndTime(), cmlabs::PsyDateAndTime::mon, and cmlabs::PsyDateAndTime::year.
Referenced by _wrap_PrintDateSortableDelimiter__SWIG_0(), _wrap_PrintDateSortableDelimiter__SWIG_0(), _wrap_PrintDateSortableDelimiter__SWIG_1(), _wrap_PrintDateSortableDelimiter__SWIG_1(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintDateSortableDelimiter_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintDateSortableDelimiter_1_1SWIG_11(), and PrintDateStringSortableDelimiter().
| std::string cmlabs::PrintDateString | ( | uint64 | t, |
| bool | local = true ) |
Definition at line 694 of file PsyTime.cpp.
References PrintDate().
Referenced by _wrap_PrintDateString__SWIG_0(), _wrap_PrintDateString__SWIG_0(), _wrap_PrintDateString__SWIG_1(), _wrap_PrintDateString__SWIG_1(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintDateString_1_1SWIG_10(), and Java_com_cmlabs_cmsdk_cmsdkJNI_PrintDateString_1_1SWIG_11().
| std::string cmlabs::PrintDateStringSortable | ( | uint64 | t, |
| bool | local = true ) |
Definition at line 703 of file PsyTime.cpp.
References PrintDateSortable().
Referenced by _wrap_PrintDateStringSortable__SWIG_0(), _wrap_PrintDateStringSortable__SWIG_0(), _wrap_PrintDateStringSortable__SWIG_1(), _wrap_PrintDateStringSortable__SWIG_1(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintDateStringSortable_1_1SWIG_10(), and Java_com_cmlabs_cmsdk_cmsdkJNI_PrintDateStringSortable_1_1SWIG_11().
| std::string cmlabs::PrintDateStringSortableDelimiter | ( | uint64 | t, |
| const char * | del, | ||
| bool | local = true ) |
Definition at line 712 of file PsyTime.cpp.
References PrintDateSortableDelimiter().
Referenced by _wrap_PrintDateStringSortableDelimiter__SWIG_0(), _wrap_PrintDateStringSortableDelimiter__SWIG_0(), _wrap_PrintDateStringSortableDelimiter__SWIG_1(), _wrap_PrintDateStringSortableDelimiter__SWIG_1(), Internal_StatsLog(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintDateStringSortableDelimiter_1_1SWIG_10(), and Java_com_cmlabs_cmsdk_cmsdkJNI_PrintDateStringSortableDelimiter_1_1SWIG_11().
| char * cmlabs::PrintTime | ( | uint64 | t, |
| bool | local = true, | ||
| bool | us = true, | ||
| bool | ms = true ) |
Full date + time-of-day.
Definition at line 527 of file PsyTime.cpp.
References cmlabs::PsyDateAndTime::day, GetDateAndTime(), cmlabs::PsyDateAndTime::hour, cmlabs::PsyDateAndTime::min, cmlabs::PsyDateAndTime::mon, cmlabs::PsyDateAndTime::msec, cmlabs::PsyDateAndTime::sec, cmlabs::PsyDateAndTime::usec, and cmlabs::PsyDateAndTime::year.
Referenced by _wrap_PrintTime__SWIG_0(), _wrap_PrintTime__SWIG_0(), _wrap_PrintTime__SWIG_1(), _wrap_PrintTime__SWIG_1(), _wrap_PrintTime__SWIG_2(), _wrap_PrintTime__SWIG_2(), _wrap_PrintTime__SWIG_3(), _wrap_PrintTime__SWIG_3(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTime_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTime_1_1SWIG_11(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTime_1_1SWIG_12(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTime_1_1SWIG_13(), cmlabs::ObsTime::print(), and PrintTimeString().
| char * cmlabs::PrintTimeDif | ( | uint64 | t, |
| bool | us = true, | ||
| bool | ms = true ) |
Format a µs duration with scale-adaptive units: "250us", "1.500ms", "2.750s", "2m 3s", "01:02:03", "3 days 01:02:03".
Definition at line 601 of file PsyTime.cpp.
References cmlabs::PsyDateAndTime::day, GetTimeDifference(), cmlabs::PsyDateAndTime::hour, cmlabs::PsyDateAndTime::min, cmlabs::PsyDateAndTime::mon, cmlabs::PsyDateAndTime::sec, SECS_PER_DAY, SECS_PER_HOUR, cmlabs::utils::strcpyavail(), cmlabs::PsyDateAndTime::usec, cmlabs::PsyDateAndTime::yday, and cmlabs::PsyDateAndTime::year.
Referenced by _wrap_PrintTimeDif__SWIG_0(), _wrap_PrintTimeDif__SWIG_0(), _wrap_PrintTimeDif__SWIG_1(), _wrap_PrintTimeDif__SWIG_1(), _wrap_PrintTimeDif__SWIG_2(), _wrap_PrintTimeDif__SWIG_2(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeDif_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeDif_1_1SWIG_11(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeDif_1_1SWIG_12(), and PrintTimeDifString().
| std::string cmlabs::PrintTimeDifString | ( | uint64 | t, |
| bool | us = true, | ||
| bool | ms = true ) |
Definition at line 722 of file PsyTime.cpp.
References PrintTimeDif().
Referenced by _wrap_PrintTimeDifString__SWIG_0(), _wrap_PrintTimeDifString__SWIG_0(), _wrap_PrintTimeDifString__SWIG_1(), _wrap_PrintTimeDifString__SWIG_1(), _wrap_PrintTimeDifString__SWIG_2(), _wrap_PrintTimeDifString__SWIG_2(), cmlabs::RequestGateway::callInternalAPI(), cmlabs::MemoryManager::create(), Internal_MessageScript(), Internal_Print(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeDifString_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeDifString_1_1SWIG_11(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeDifString_1_1SWIG_12(), cmlabs::RequestGateway::runExec(), cmlabs::ThreadManager::threadMonitoring(), cmlabs::NetworkManager::UnitTest(), and cmlabs::RequestGateway::UnitTest().
| std::string cmlabs::PrintTimeNowString | ( | bool | local = true, |
| bool | us = true, | ||
| bool | ms = true ) |
Format GetTimeNow().
Definition at line 672 of file PsyTime.cpp.
References GetTimeNow(), and PrintTimeString().
Referenced by _wrap_PrintTimeNowString__SWIG_0(), _wrap_PrintTimeNowString__SWIG_0(), _wrap_PrintTimeNowString__SWIG_1(), _wrap_PrintTimeNowString__SWIG_1(), _wrap_PrintTimeNowString__SWIG_2(), _wrap_PrintTimeNowString__SWIG_2(), _wrap_PrintTimeNowString__SWIG_3(), _wrap_PrintTimeNowString__SWIG_3(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeNowString_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeNowString_1_1SWIG_11(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeNowString_1_1SWIG_12(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeNowString_1_1SWIG_13(), cmlabs::LogSystem::LogSystemDebug(), cmlabs::LogSystem::LogSystemPrint(), and cmlabs::WebsocketTestServer::receiveWebsocketData().
| char * cmlabs::PrintTimeOnly | ( | uint64 | t, |
| bool | local = true, | ||
| bool | us = true, | ||
| bool | ms = true ) |
Time-of-day only.
Definition at line 539 of file PsyTime.cpp.
References GetDateAndTime(), cmlabs::PsyDateAndTime::hour, cmlabs::PsyDateAndTime::min, cmlabs::PsyDateAndTime::msec, cmlabs::PsyDateAndTime::sec, and cmlabs::PsyDateAndTime::usec.
Referenced by _wrap_PrintTimeOnly__SWIG_0(), _wrap_PrintTimeOnly__SWIG_0(), _wrap_PrintTimeOnly__SWIG_1(), _wrap_PrintTimeOnly__SWIG_1(), _wrap_PrintTimeOnly__SWIG_2(), _wrap_PrintTimeOnly__SWIG_2(), _wrap_PrintTimeOnly__SWIG_3(), _wrap_PrintTimeOnly__SWIG_3(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeOnly_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeOnly_1_1SWIG_11(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeOnly_1_1SWIG_12(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeOnly_1_1SWIG_13(), and PrintTimeOnlyString().
| std::string cmlabs::PrintTimeOnlyString | ( | uint64 | t, |
| bool | local = true, | ||
| bool | us = true, | ||
| bool | ms = true ) |
Definition at line 685 of file PsyTime.cpp.
References PrintTimeOnly().
Referenced by _wrap_PrintTimeOnlyString__SWIG_0(), _wrap_PrintTimeOnlyString__SWIG_0(), _wrap_PrintTimeOnlyString__SWIG_1(), _wrap_PrintTimeOnlyString__SWIG_1(), _wrap_PrintTimeOnlyString__SWIG_2(), _wrap_PrintTimeOnlyString__SWIG_2(), _wrap_PrintTimeOnlyString__SWIG_3(), _wrap_PrintTimeOnlyString__SWIG_3(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeOnlyString_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeOnlyString_1_1SWIG_11(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeOnlyString_1_1SWIG_12(), and Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeOnlyString_1_1SWIG_13().
| char * cmlabs::PrintTimeSortable | ( | uint64 | t, |
| bool | local ) |
Sortable date+time, second resolution.
Definition at line 558 of file PsyTime.cpp.
References cmlabs::PsyDateAndTime::day, GetDateAndTime(), cmlabs::PsyDateAndTime::hour, cmlabs::PsyDateAndTime::min, cmlabs::PsyDateAndTime::mon, cmlabs::PsyDateAndTime::sec, and cmlabs::PsyDateAndTime::year.
Referenced by _wrap_PrintTimeSortable(), _wrap_PrintTimeSortable(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeSortable(), and PrintTimeSortableString().
| char * cmlabs::PrintTimeSortableMicrosec | ( | uint64 | t, |
| bool | local ) |
Sortable date+time with microseconds.
Definition at line 572 of file PsyTime.cpp.
References cmlabs::PsyDateAndTime::day, GetDateAndTime(), cmlabs::PsyDateAndTime::hour, cmlabs::PsyDateAndTime::min, cmlabs::PsyDateAndTime::mon, cmlabs::PsyDateAndTime::msec, cmlabs::PsyDateAndTime::sec, cmlabs::PsyDateAndTime::usec, and cmlabs::PsyDateAndTime::year.
Referenced by _wrap_PrintTimeSortableMicrosec(), _wrap_PrintTimeSortableMicrosec(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeSortableMicrosec(), and PrintTimeSortableMicrosecString().
| std::string cmlabs::PrintTimeSortableMicrosecString | ( | uint64 | t, |
| bool | local = true ) |
Sortable date+time with microseconds.
Definition at line 749 of file PsyTime.cpp.
References PrintTimeSortableMicrosec().
Referenced by _wrap_PrintTimeSortableMicrosecString__SWIG_0(), _wrap_PrintTimeSortableMicrosecString__SWIG_0(), _wrap_PrintTimeSortableMicrosecString__SWIG_1(), _wrap_PrintTimeSortableMicrosecString__SWIG_1(), Internal_StatsLog(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeSortableMicrosecString_1_1SWIG_10(), and Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeSortableMicrosecString_1_1SWIG_11().
| char * cmlabs::PrintTimeSortableMillisec | ( | uint64 | t, |
| bool | local ) |
Sortable date+time with milliseconds.
Definition at line 565 of file PsyTime.cpp.
References cmlabs::PsyDateAndTime::day, GetDateAndTime(), cmlabs::PsyDateAndTime::hour, cmlabs::PsyDateAndTime::min, cmlabs::PsyDateAndTime::mon, cmlabs::PsyDateAndTime::msec, cmlabs::PsyDateAndTime::sec, and cmlabs::PsyDateAndTime::year.
Referenced by _wrap_PrintTimeSortableMillisec(), _wrap_PrintTimeSortableMillisec(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeSortableMillisec(), and PrintTimeSortableMillisecString().
| std::string cmlabs::PrintTimeSortableMillisecString | ( | uint64 | t, |
| bool | local = true ) |
Sortable date+time with milliseconds.
Definition at line 740 of file PsyTime.cpp.
References PrintTimeSortableMillisec().
Referenced by _wrap_PrintTimeSortableMillisecString__SWIG_0(), _wrap_PrintTimeSortableMillisecString__SWIG_0(), _wrap_PrintTimeSortableMillisecString__SWIG_1(), _wrap_PrintTimeSortableMillisecString__SWIG_1(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeSortableMillisecString_1_1SWIG_10(), and Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeSortableMillisecString_1_1SWIG_11().
| std::string cmlabs::PrintTimeSortableString | ( | uint64 | t, |
| bool | local = true ) |
Sortable date+time, second resolution.
Definition at line 731 of file PsyTime.cpp.
References PrintTimeSortable().
Referenced by _wrap_PrintTimeSortableString__SWIG_0(), _wrap_PrintTimeSortableString__SWIG_0(), _wrap_PrintTimeSortableString__SWIG_1(), _wrap_PrintTimeSortableString__SWIG_1(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeSortableString_1_1SWIG_10(), and Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeSortableString_1_1SWIG_11().
| std::string cmlabs::PrintTimeString | ( | uint64 | t, |
| bool | local = true, | ||
| bool | us = true, | ||
| bool | ms = true ) |
Definition at line 676 of file PsyTime.cpp.
References PrintTime().
Referenced by _wrap_PrintTimeString__SWIG_0(), _wrap_PrintTimeString__SWIG_0(), _wrap_PrintTimeString__SWIG_1(), _wrap_PrintTimeString__SWIG_1(), _wrap_PrintTimeString__SWIG_2(), _wrap_PrintTimeString__SWIG_2(), _wrap_PrintTimeString__SWIG_3(), _wrap_PrintTimeString__SWIG_3(), cmlabs::DataMessage::getAsString(), cmlabs::DataMessage::getAsStringArray(), cmlabs::DataMessage::getAsStringMap(), cmlabs::DataMessage::getUserEntriesAsJSON(), cmlabs::DataMessage::getUserEntriesAsString(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeString_1_1SWIG_10(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeString_1_1SWIG_11(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeString_1_1SWIG_12(), Java_com_cmlabs_cmsdk_cmsdkJNI_PrintTimeString_1_1SWIG_13(), cmlabs::GenericMemoryMap< T, ID >::PrintAllEntries(), cmlabs::GenericMemoryMap< T, ID >::PrintAllEntriesHTML(), cmlabs::MessagePlayer::printAllString(), PrintTimeNowString(), cmlabs::DataMapsMemory::setRequestStatus(), cmlabs::DataMessage::toCSV(), cmlabs::CallLogEntry::toJSON(), cmlabs::DataMessage::toJSON(), cmlabs::DataMessageHeader::toJSON(), cmlabs::GenericObservation< T >::toJSON(), cmlabs::ObsTime::toJSON(), cmlabs::DataMessage::toXML(), cmlabs::DataMessageHeader::toXML(), and cmlabs::DataMapsMemory::waitForRequestReply().
| bool cmlabs::PsyTime_UnitTest | ( | ) |
Run the PsyTime unit tests.
Definition at line 764 of file PsyTime.cpp.
References cmlabs::unittest::detail(), cmlabs::PsyDateAndTime::dstsec, cmlabs::unittest::fail(), GetDateAndTime(), GetTimeDifference(), GetTimeNow(), cmlabs::PsyDateAndTime::hour, cmlabs::unittest::metric(), cmlabs::PsyDateAndTime::min, cmlabs::PsyDateAndTime::negative, cmlabs::unittest::progress(), cmlabs::PsyDateAndTime::sec, cmlabs::utils::Sleep(), cmlabs::PsyDateAndTime::tzsec, and cmlabs::PsyDateAndTime::usec.
Referenced by _wrap_PsyTime_UnitTest(), _wrap_PsyTime_UnitTest(), Java_com_cmlabs_cmsdk_cmsdkJNI_PsyTime_1UnitTest(), and Register_PsyTime_Tests().
| bool cmlabs::SetCurrentNetSyncDif | ( | int64 | netTimeDif | ) |
Set the network time difference for a slave node so its GetTimeNow() matches the master.
| netTimeDif | Signed offset in µs between this node and the time master. |
Definition at line 135 of file PsyTime.cpp.
References NetTimeAdjust.
Referenced by _wrap_SetCurrentNetSyncDif(), _wrap_SetCurrentNetSyncDif(), and Java_com_cmlabs_cmsdk_cmsdkJNI_SetCurrentNetSyncDif().
| bool cmlabs::SetCurrentTimeSyncData | ( | uint64 | tmc, |
| int64 | netTimeAdjust ) |
Install externally computed sync data (e.g.
received from the time master).
| tmc | Time Mapping Constant to use. |
| netTimeAdjust | Signed network adjustment in µs. |
Definition at line 140 of file PsyTime.cpp.
References CurrentTMC, CurrentTMCMode, NetTimeAdjust, and TMC_SLAVE.
Referenced by _wrap_SetCurrentTimeSyncData(), _wrap_SetCurrentTimeSyncData(), and Java_com_cmlabs_cmsdk_cmsdkJNI_SetCurrentTimeSyncData().
| uint64 cmlabs::SyncToHardwareClock | ( | ) |
Recompute the Time Mapping Constant by anchoring the monotonic clock to the wall clock.
Waits for a wall-clock tick edge for accuracy (gettimeofday loop on POSIX).
Definition at line 168 of file PsyTime.cpp.
References CurrentTMC, and USEC_YEAR_0_TO_1970.
Referenced by _wrap_SyncToHardwareClock(), _wrap_SyncToHardwareClock(), GetTimeNow(), and Java_com_cmlabs_cmsdk_cmsdkJNI_SyncToHardwareClock().
|
static |
Current Time Mapping Constant (µs offset from monotonic clock to absolute PsyTime).
Definition at line 223 of file PsyTime.h.
Referenced by GetCurrentTimeSyncData(), GetTimeNow(), Java_com_cmlabs_cmsdk_cmsdkJNI_CurrentTMC_1get(), Java_com_cmlabs_cmsdk_cmsdkJNI_CurrentTMC_1set(), SetCurrentTimeSyncData(), Swig_var_CurrentTMC_get(), Swig_var_CurrentTMC_set(), and SyncToHardwareClock().
|
static |
Current TMC role: TMC_MASTER or TMC_SLAVE.
Definition at line 225 of file PsyTime.h.
Referenced by GetTimeNow(), Java_com_cmlabs_cmsdk_cmsdkJNI_CurrentTMCMode_1get(), Java_com_cmlabs_cmsdk_cmsdkJNI_CurrentTMCMode_1set(), SetCurrentTimeSyncData(), Swig_var_CurrentTMCMode_get(), and Swig_var_CurrentTMCMode_set().
|
static |
PsyTime timestamp of the last hardware-clock sync.
Definition at line 227 of file PsyTime.h.
Referenced by GetTimeNow(), Java_com_cmlabs_cmsdk_cmsdkJNI_LastTMCSync_1get(), Java_com_cmlabs_cmsdk_cmsdkJNI_LastTMCSync_1set(), Swig_var_LastTMCSync_get(), and Swig_var_LastTMCSync_set().
|
static |
Signed network time adjustment (µs) applied when slaved to a remote master.
Definition at line 229 of file PsyTime.h.
Referenced by GetCurrentTimeSyncData(), GetTimeNow(), Java_com_cmlabs_cmsdk_cmsdkJNI_NetTimeAdjust_1get(), Java_com_cmlabs_cmsdk_cmsdkJNI_NetTimeAdjust_1set(), SetCurrentNetSyncDif(), SetCurrentTimeSyncData(), Swig_var_NetTimeAdjust_get(), and Swig_var_NetTimeAdjust_set().
|
static |
Abbreviated weekday names indexed 1..7 (Mon..Sun); index 0 is "None".
Definition at line 134 of file PsyTime.h.
Referenced by GetHTTPTime(), Java_com_cmlabs_cmsdk_cmsdkJNI_PsyDays_1get(), and Swig_var_PsyDays_get().
|
static |
Full weekday names indexed 1..7 (Monday..Sunday); index 0 is "None".
Definition at line 136 of file PsyTime.h.
Referenced by Java_com_cmlabs_cmsdk_cmsdkJNI_PsyDaysFull_1get(), and Swig_var_PsyDaysFull_get().
|
static |
Abbreviated month names indexed 1..12 (Jan..Dec); index 0 is "None".
Definition at line 138 of file PsyTime.h.
Referenced by GetHTTPTime(), GetTimeFromString(), Java_com_cmlabs_cmsdk_cmsdkJNI_PsyMonths_1get(), and Swig_var_PsyMonths_get().
|
static |
Full month names indexed 1..12; index 0 is "None".
Definition at line 140 of file PsyTime.h.
Referenced by GetTimeFromString(), Java_com_cmlabs_cmsdk_cmsdkJNI_PsyMonthsFull_1get(), and Swig_var_PsyMonthsFull_get().