add PISystemTime::toFrequency(), add PILog

This commit is contained in:
2024-09-13 18:00:48 +03:00
parent aa2f117075
commit 9a352bfc83
5 changed files with 204 additions and 0 deletions

View File

@@ -117,6 +117,11 @@ void PISystemTime::toTimespec(void * ts) {
}
PISystemTime::Frequency PISystemTime::toFrequency() {
return PISystemTime::Frequency::fromSystemTime(*this);
}
PIString PISystemTime::toString() const {
static const PISystemTime is_abs_thr = 3650._d; // 10 years
if ((*this) >= is_abs_thr) return PIDateTime::fromSystemTime((*this)).toString("yyyy-MM-dd hh:mm:ss.zzz");

View File

@@ -260,6 +260,10 @@ public:
//! \~russian На *nix системах присваивает время к timespec структуре
void toTimespec(void * ts);
//! \~english Returns \a Frequency that corresponds this time interval
//! \~russian Возвращает \a Frequency соответствующую этому временному интервалу
PISystemTime::Frequency toFrequency();
//! \~english Returns "yyyy-MM-dd hh:mm:ss.zzz" for absolute time and "<V> <d|h|m|s|ms|us|ns> ..." for relative
//! \~russian Возвращает "yyyy-MM-dd hh:mm:ss.zzz" для абсолютного времени и "<V> <d|h|m|s|ms|us|ns> ..." для относительного
PIString toString() const;