LCOV - code coverage report
Current view: top level - engine/time - durations.hpp (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 8 8
Test Date: 2026-03-11 04:45:14 Functions: 100.0 % 5 5

            Line data    Source code
       1              : #pragma once
       2              : 
       3              : #include <chrono>
       4              : 
       5              : namespace jage::engine::time::inline durations {
       6              : 
       7              : using seconds = std::chrono::duration<double, std::ratio<1>>;
       8              : using milliseconds = std::chrono::duration<double, std::milli>;
       9              : using microseconds = std::chrono::duration<double, std::micro>;
      10              : using nanoseconds = std::chrono::duration<double, std::nano>;
      11              : 
      12            1 : constexpr auto operator""_s(unsigned long long value) -> seconds {
      13            1 :   return seconds{static_cast<long double>(value)};
      14              : }
      15              : 
      16              : constexpr auto operator""_ms(long double value) -> milliseconds {
      17              :   return milliseconds{value};
      18              : }
      19              : 
      20            1 : constexpr auto operator""_ms(unsigned long long value) -> milliseconds {
      21            1 :   return milliseconds{static_cast<long double>(value)};
      22              : }
      23              : 
      24              : constexpr auto operator""_us(long double value) -> microseconds {
      25              :   return microseconds{value};
      26              : }
      27              : 
      28              : constexpr auto operator""_ns(long double value) -> nanoseconds {
      29              :   return nanoseconds{value};
      30              : }
      31              : 
      32           87 : constexpr auto operator""_ns(unsigned long long value) -> nanoseconds {
      33           87 :   return nanoseconds{static_cast<long double>(value)};
      34              : }
      35              : 
      36              : template <class TToDuration, class TFromDuration>
      37          336 : constexpr auto cast(const TFromDuration &duration) -> TToDuration {
      38          336 :   return std::chrono::duration_cast<TToDuration>(duration);
      39              : }
      40              : 
      41              : } // namespace jage::engine::time::inline durations
        

Generated by: LCOV version 2.0-1