PosixClock.cpp 526 B

1234567891011121314151617181920212223
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2023-03-15
  6. * Changed: 2023-03-15
  7. *
  8. * */
  9. #include <ctime>
  10. #include <ls-std/time/system-time/PosixClock.hpp>
  11. using ls::std::time::PosixClock;
  12. PosixClock::PosixClock() = default;
  13. PosixClock::~PosixClock() noexcept = default;
  14. bool PosixClock::setTime(uint32_t _timeStamp)
  15. {
  16. timespec timespec{_timeStamp, 0};
  17. return clock_settime(CLOCK_REALTIME, &timespec) == 0;
  18. }