Avara3D 0.2.0
C++ API reference
Chrono.h
1//
2// Chrono.h
3// avara3d
4//
5// Created by Morgan Davis on 1/1/26.
6// Copyright © 2026 Morgan K Davis. All rights reserved.
7//
8
9#ifndef AVARA3D_UTIL_CHRONO_H
10#define AVARA3D_UTIL_CHRONO_H
11
12#include <chrono>
13
14namespace a3d::util::chrono {
15
16 // [Public Functions]
17
19 template<class Rep, class Period>
20 constexpr double Seconds(std::chrono::duration<Rep, Period> duration) noexcept {
21 return std::chrono::duration<double>(duration).count();
22 }
23
25 template<class Rep, class Period>
26 constexpr double Milliseconds(std::chrono::duration<Rep, Period> duration) noexcept {
27 return std::chrono::duration<double, std::milli>(duration).count();
28 }
29
30}
31
32#endif // AVARA3D_UTIL_CHRONO_H