Top Hat was created by students for students, with the goal of helping everyone succeed in higher education. Whether you're logging in for the first time or looking to get the most out of our platform, we’re here to help.
Transform your course with Top Hat. Engage students with in-class polls, quizzes, and discussions, AI-powered assistance, and personalized content. Learn more!
Are you a teaching assistant or co-instructor? Contact your Top Hat course instructor and request access. You will then receive an email invitation to join the course.
Welcome to Top Hat! Join Session By clicking Join Session, you confirm that you have read and agree to our User Agreement
Class template std::chrono::duration represents a time interval. It consists of a count of ticks of type Rep and a tick period, where the tick period is a compile-time rational fraction representing the time in seconds from one tick to the next. The only data stored in a duration is a tick count of type Rep. If Rep is floating point, then the duration can represent fractions of ticks. Period ...
Chrono library (since C++11) The chrono library defines several main types as well as utility functions and common typedefs: clocks time points durations
Duration Defined in namespace std::chrono duration (C++11) a time interval (class template) [edit] treat_as_floating_point (C++11) indicates that a duration is convertible to duration with different tick period (class template) [edit] duration_values (C++11) constructs zero, min, and max values of a tick count of given type (class template) [edit]
Example Run this code #includeConverts a std::chrono::duration to a duration of different type ToDuration. The function only participate in overload resolution if ToDuration is a specialization of std::chrono::duration.