diff --git a/openVulkanoCpp/Math/Timestamp.hpp b/openVulkanoCpp/Math/Timestamp.hpp index 21f95c2..b99fb95 100644 --- a/openVulkanoCpp/Math/Timestamp.hpp +++ b/openVulkanoCpp/Math/Timestamp.hpp @@ -23,6 +23,18 @@ namespace openVulkanoCpp::Math [[nodiscard]] uint64_t GetNanos() const { return timestamp; } [[nodiscard]] double GetSeconds() const { return timestamp * NANOS_TO_SECONDS; } + + Timestamp& operator+=(const Timestamp& rhs) + { + timestamp += rhs.timestamp; + return *this; + } + + Timestamp& operator-=(const Timestamp& rhs) + { + timestamp -= rhs.timestamp; + return *this; + } }; inline bool operator==(const Timestamp& lhs, const Timestamp& rhs) @@ -54,4 +66,19 @@ namespace openVulkanoCpp::Math { return !(rhs < lhs); } + + inline Timestamp operator-(const Timestamp& lhs, const Timestamp& rhs) + { + return Timestamp(lhs.GetNanos() - rhs.GetNanos()); + } + + inline Timestamp operator+(const Timestamp& lhs, const Timestamp& rhs) + { + return Timestamp(lhs.GetNanos() + rhs.GetNanos()); + } + + inline double operator/(const Timestamp& lhs, const Timestamp& rhs) + { + return lhs.GetNanos() / static_cast(rhs.GetNanos()); + } } \ No newline at end of file