AlpacaLibrary/Include/Core/Time.hpp

22 lines
683 B
C++

#ifndef TIME_HPP_INCLUDED
#define TIME_HPP_INCLUDED
#include <cstdint>
#include <functional>
/** @addtogroup Time
* @{ */
void Wait(std::int64_t Duration);
std::uint64_t CurrentTimeMillis();
std::uint64_t CurrentTimeNanos();
bool WaitFunc(std::uint32_t Duration, std::uint32_t Step, std::function<bool()> Func);
bool WaitFunc(std::uint32_t Duration, std::uint32_t Step, std::function<bool()> Func, bool Result);
std::string MillisToHumanShort(std::int64_t Millseconds); // HH:MM:SS
std::string MillisToHumanMedium(std::int64_t Milliseconds); // 1h 30m 50s
std::string MillisToHumanLong(std::int64_t Millseconds); // Hours, Minutes, Seconds
/** @} */
#endif // TIME_HPP_INCLUDED