--- ---
|
TGUI
1.0-dev
|
Wrapper for durations. More...
#include <TGUI/Duration.hpp>
Public Member Functions | |
| constexpr | Duration () |
| Creates an zero-length duration. | |
| template<typename Rep , typename Period > | |
| constexpr | Duration (std::chrono::duration< Rep, Period > duration) |
| Creates the duration from any kind of std::chrono::duration. | |
| constexpr | Duration (int milliseconds) |
| Creates the duration from a given amount of milliseconds. | |
| Duration (sf::Time duration) | |
| Creates the duration from an sf::Time instance. | |
| TGUI_NODISCARD constexpr float | asSeconds () const |
| Returns the duration in seconds. | |
| constexpr | operator std::chrono::nanoseconds () const |
| Convert the duration to std::chrono::nanoseconds. | |
| template<typename Rep , typename Period > | |
| constexpr | operator std::chrono::duration< Rep, Period > () const |
| Convert the duration to std::chrono::duration. | |
| operator sf::Time () const | |
| Convert the duration to sf::Time. | |
Wrapper for durations.
You do not have to use class directly in your code unless you want to store the duration. Functions taking tgui::Duration as parameter can be directly passed arguments like:
|
inlineconstexpr |
Creates the duration from a given amount of milliseconds.
| milliseconds | Amount of milliseconds to store in the duration |