#include <spTimer.hpp>
List of all members.
Detailed Description
The Timer class can be used as stop watch or just to have simple time access.
- Since:
- Version 3.2
Constructor & Destructor Documentation
sp::io::Timer::Timer |
( |
u64 |
Duration = 0 |
) |
|
sp::io::Timer::Timer |
( |
bool |
UseFrequenceQuery |
) |
|
sp::io::Timer::~Timer |
( |
|
) |
[virtual] |
Member Function Documentation
u64 sp::io::Timer::convertDuration |
( |
u64 |
Duration |
) |
[static] |
Converts the given duration when the 'global speed multiplier' is enabled.
- Returns:
- Converted duration. When the multiplier is 2.0 the return value of 1000 milliseconds is 500. When the multiplier is 0.25 the return value of 1000 milliseconds is 4000.
bool sp::io::Timer::finish |
( |
|
) |
|
Returns true if the timer has finished.
f64 sp::io::Timer::getCurrentFPS |
( |
|
) |
|
Returns the statistic count of frames per seconds.
- Note:
- This can only be used if this timer was created with a frequence query. Otherwise the function will always return 60.
io::Timer timer(true);
f64 fps = timer.getCurrentFPS();
- See also:
- getElapsedMicroseconds
u32 sp::io::Timer::getElapsedFrames |
( |
u64 |
Duration = 1000 |
) |
[static] |
Returns the count of frame since the elapsed second.
- Parameters:
-
| Duration,: | Specifies the duration after which the elapsed frames will be updated. |
- Note:
- Call this function only once in each frame!
u64 sp::io::Timer::getElapsedMicroseconds |
( |
|
) |
|
Returns the elapsed microseconds since the last reset or creation time.
- Note:
- This can only be used if this timer was created with a frequence query.
- See also:
- resetClockCounter
f64 sp::io::Timer::getFPS |
( |
|
) |
[static] |
Returns the statistic count of frames per seconds.
- Parameters:
-
| UpdateFrameRate,: | Specifies the count of frames which need to elapse before the new FPS value will be computed (e.g. 5 is a good value). |
- Returns:
- Frames per second as double precision floating point (statistic value).
f32 sp::io::Timer::getGlobalSpeed |
( |
|
) |
[static] |
Returns the global speed. When the global FPS is 60.0 this value is 1.0. This the global FPS value is greater the return value is smaller. This is used that animations and other scene movements look always the same regardless of FPS.
- See also:
- getFPS
bool sp::io::Timer::getGlobalSpeedEnable |
( |
|
) |
[static] |
Returbs the global speed adjustment. By default enabled.
f32 sp::io::Timer::getGlobalSpeedMultiplier |
( |
|
) |
[static] |
Returbs the global speed multiplier. By default 1.0.
Returns the specified time value.
Returns current time as a string in the form "DD/MM/YYYY HH:MM:SS" (e.g. "03/01/2008 15:23:46").
u64 sp::io::Timer::microsecs |
( |
|
) |
[static] |
Returns the count of elapsed microseconds since your computer started.
- Note:
- This is actually only supported for Linux systems. For Windows you can use "getElapsedMicroseconds".
- See also:
- getElapsedMicroseconds
u64 sp::io::Timer::millisecs |
( |
|
) |
[static] |
Returns the count of elapsed milliseconds since your computer started.
void sp::io::Timer::pause |
( |
bool |
isPaused = true |
) |
|
bool sp::io::Timer::paused |
( |
|
) |
const [inline] |
Returns true if the timer was paused.
void sp::io::Timer::reset |
( |
|
) |
|
Resets the stop watch and uses the same duration as before.
void sp::io::Timer::resetClockCounter |
( |
|
) |
|
u64 sp::io::Timer::secs |
( |
|
) |
[static] |
Returns the count of elapsed seconds since your computer started.
void sp::io::Timer::setGlobalSpeedEnable |
( |
bool |
Enable |
) |
[static] |
Enables the global speed adjustment. By default enabled.
- See also:
- getGlobalSpeed
void sp::io::Timer::setGlobalSpeedMultiplier |
( |
f32 |
Factor |
) |
[static] |
Sets the global speed multiplier. By default 1.0. If you want that all animations etc. run faster, increase this value.
- See also:
- getGlobalSpeed
void sp::io::Timer::sleep |
( |
u32 |
Milliseconds |
) |
[static] |
Waits for the specified time.
void sp::io::Timer::start |
( |
u64 |
Duration |
) |
|
Starts the stop watch with the given duration.
void sp::io::Timer::stop |
( |
|
) |
|
static void sp::io::Timer::yield |
( |
|
) |
[inline, static] |
Waits for 1 millisecond to give other processes time to run. This can be used in multi-threading.
Friends And Related Function Documentation
Member Data Documentation
The documentation for this class was generated from the following files:
- D:/SoftwareEntwicklung/C++/HLC/Tools/SoftPixelEngine/repository/sources/Base/spTimer.hpp
- D:/SoftwareEntwicklung/C++/HLC/Tools/SoftPixelEngine/repository/sources/Base/spTimer.cpp