This class provide a independant local time system. More...
#include <time_nl.h>
Inherited by NLNET::_CUniTime.
Static Public Member Functions | |
| static uint32 | getSecondsSince1970 () |
| Return the number of second since midnight (00:00:00), January 1, 1970, coordinated universal time, according to the system clock. | |
| static TTime | getLocalTime () |
| Return the number of second since midnight (00:00:00), January 1, 1970, coordinated universal time, according to the system clock. | |
| static TTicks | getPerformanceTime () |
| Return the time in processor ticks. | |
| static double | ticksToSecond (TTicks ticks) |
| Convert a ticks count into second. | |
| static std::string | getHumanRelativeTime (sint32 nbSeconds) |
| Build a human readable string of a time difference in second. | |
This class provide a independant local time system.
Definition at line 55 of file time_nl.h.
| std::string NLMISC::CTime::getHumanRelativeTime | ( | sint32 | nbSeconds | ) | [static] |
Build a human readable string of a time difference in second.
The result will be of the form '1 years 2 months 2 days 10 seconds'
compute the different parts
Definition at line 268 of file time_nl.cpp.
| TTime NLMISC::CTime::getLocalTime | ( | ) | [static] |
Return the number of second since midnight (00:00:00), January 1, 1970, coordinated universal time, according to the system clock.
The time returned is UTC (aka GMT+0), ie it does not have the local time ajustement nor it have the daylight saving ajustement. This values is the same on all computer if computers are synchronized (with NTP for example). Return the local time in milliseconds. Use it only to measure time difference, the absolute value does not mean anything. On Unix, getLocalTime() will try to use the Monotonic Clock if available, otherwise the value can jump backwards if the system time is changed by a user or a NTP time sync process. The value is different on 2 different computers; use the CUniTime class to get a universal time that is the same on all computers.
The time returned is UTC (aka GMT+0), ie it does not have the local time ajustement nor it have the daylight saving ajustement. This values is the same on all computer if computers are synchronized (with NTP for example).
Definition at line 80 of file time_nl.cpp.
References nlerror.
Referenced by NL3D::CCloudScape::anim(), NL3D::CEvent3dMouseListener::CEvent3dMouseListener(), NLMISC::CFile::checkFileChange(), NLSOUND::CAudioMixerUser::curTime(), NLSOUND::CComplexSource::getTime(), NL3D::CEvent3dMouseListener::getViewMatrix(), loadForm(), loadForm2(), loadFormNoPackedSheet(), loadFormNoPackedSheet2(), NLSOUND::CComplexSource::onEvent(), NLSOUND::CComplexSource::onUpdate(), NLMISC::CCPUTimeStat::peekMeasures(), NLSOUND::CComplexSource::playStuf(), NLSOUND::CBackgroundSoundManager::setBackgroundFlags(), NLMISC::CCoTask::sleep(), ticksToSecond(), NLSOUND::CSoundDriverDSound::TimerCallback(), NLSOUND::CSoundDriverDSound::update(), NLSOUND::CAudioMixerUser::update(), and NLSOUND::CBackgroundSoundManager::updateBackgroundStatus().
| TTicks NLMISC::CTime::getPerformanceTime | ( | ) | [static] |
Return the time in processor ticks.
Use it for profile purpose. If the performance time is not supported on this hardware, it returns 0.
Definition at line 178 of file time_nl.cpp.
References nlwarning.
Referenced by NLMISC::CBufFIFO::front(), NLMISC::CSystemInfo::getProcessorFrequency(), NL3D::CVertexBufferHardARB::lock(), NL3D::CVertexBufferHardGLNVidia::lock(), NL3D::CVolatileVertexBuffer::lock(), NL3D::CVBDrvInfosD3D::lock(), NL3D::CVolatileIndexBuffer::lock(), NL3D::CIBDrvInfosD3D::lock(), NLMISC::NLMISC_CATEGORISED_COMMAND(), NLMISC::CIFile::open(), NLMISC::CStopWatch::pause(), NLMISC::CBufFIFO::push(), NL3D::CScene::renderPart(), NLMISC::CBufFIFO::resize(), NLMISC::CStopWatch::resume(), NLMISC::CStopWatch::start(), NLMISC::CSimpleClock::start(), NLMISC::CStopWatch::stop(), NLMISC::CSimpleClock::stop(), ticksToSecond(), and NL3D::CVertexBufferHardARB::unlock().
| uint32 NLMISC::CTime::getSecondsSince1970 | ( | ) | [static] |
Return the number of second since midnight (00:00:00), January 1, 1970, coordinated universal time, according to the system clock.
The time returned is local, ie. it has the local time ajustement, including daylight saving if applicable. This values is the same on all computer if computers are synchronized (with NTP for example).
Definition at line 51 of file time_nl.cpp.
Convert a ticks count into second.
If the performance time is not supported on this hardware, it returns 0.0.
Definition at line 221 of file time_nl.cpp.
References getLocalTime(), and getPerformanceTime().
Referenced by NL3D::CDriverD3D::endProfileIBLock(), NL3D::CDriverGL::endProfileVBHardLock(), NL3D::CDriverD3D::endProfileVBHardLock(), NLMISC::CHTimer::estimateAfterStopTime(), NLMISC::CStopWatch::getAverageDuration(), NLMISC::CStopWatch::getDuration(), NLMISC::CStopWatch::getPartialAverage(), NLMISC::CSystemInfo::getProcessorFrequency(), NL3D::CScene::renderPart(), and NLMISC::CHTimer::startBench().
1.6.1