Fixed Windows build, changed tl::Clock documentation

This commit is contained in:
Matthias Koefferlein 2018-05-01 22:46:33 +02:00
parent 329b9a301b
commit 9084a7f519
2 changed files with 15 additions and 8 deletions

View File

@ -32,6 +32,7 @@
#endif
#include <stdio.h>
#include <time.h>
#ifndef _MSC_VER // not available on MS VC++
# include <unistd.h>
@ -53,7 +54,7 @@ int64_t msecs_to (const QDateTime &from, const QDateTime &to)
}
// -------------------------------------------------------------
// Implementation of timer
// Implementation of Timer
Timer::Timer ()
: m_user_ms (0), m_sys_ms (0), m_wall_ms (0),
@ -184,7 +185,7 @@ SelfTimer::report () const
}
// -------------------------------------------------------------
// Implementation of timer
// Implementation of Clock
Clock::Clock (double s)
{

View File

@ -149,13 +149,19 @@ private:
};
/**
* @brief An abstraction of the clock() function found in the POSIX API
* @brief An abstraction for a time measurement feature
*
* This class can be used to take the current time and
* compute time differences. The clock represents real
* time and can be used to time user interface actions.
*
* The original clock function returns the number of ticks spent in the
* user process from start of the process. On some platforms this includes
* the child processes' time as well, on others (like Linux) is does not.
* In order to provide a equivalent implementation of this function for
* other platforms, this function is provided in this module.
* @code
* tl::Clock start = tl::Clock::current ();
* ... do something
* if ((tl::Clock::current () - start).second () > 2) {
* ... took longer than 2 seconds
* }
* @/code
*/
class TL_PUBLIC Clock
{