A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.cppreference.com/w/cpp/algorithm/../chrono/system_clock/../treat_as_floating_point.html below:

std::chrono::treat_as_floating_point - cppreference.com

The std::chrono::treat_as_floating_point trait helps determine if a duration can be converted to another duration with a different tick period.

Implicit conversions between two durations normally depends on the tick period of the durations. However, implicit conversions can happen regardless of tick period if std::chrono::treat_as_floating_point<Rep>::value is true.

[edit] Helper variable template

template< class Rep >
constexpr bool treat_as_floating_point_v = treat_as_floating_point<Rep>::value;

(since C++17) [edit] Specializations

std::chrono::treat_as_floating_point may be specialized for program-defined types.

[edit] Example

Possible output:

Running some timed piece of code...
Timing stats:
  Time in milliseconds, using default rep: 2
  Time in milliseconds, using floating point rep: 2.57307
[edit] See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4