kennen:lib:duration_cast
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
— | kennen:lib:duration_cast [2019-11-20 15:08] (aktuell) – angelegt - Externe Bearbeitung 127.0.0.1 | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ====== duration_cast() ====== | ||
+ | ''# | ||
+ | |||
+ | <code cpp> | ||
+ | template <class ToDuration, class Rep, class Period> | ||
+ | ToDuration duration_cast(const duration< | ||
+ | </ | ||
+ | | ||
+ | Ist keine exakte Umrechnung möglich, wird abgerundet. | ||
+ | ==== Parameter ==== | ||
+ | | '' | ||
+ | |||
+ | ==== Ergebnis ==== | ||
+ | Rückgabewert: | ||
+ | |||
+ | ==== Siehe auch ==== | ||
+ | - | ||
+ | |||
+ | ==== Beispiel ==== | ||
+ | <code cpp duration_cast.cpp> | ||
+ | // nach: http:// | ||
+ | |||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | |||
+ | void silly_sleep_ms(unsigned int millis) | ||
+ | { | ||
+ | typedef std:: | ||
+ | typedef std:: | ||
+ | |||
+ | clock:: | ||
+ | std:: | ||
+ | clock:: | ||
+ | ms total_ms = std:: | ||
+ | |||
+ | std::cout <<" | ||
+ | << total_ms.count() << " | ||
+ | } | ||
+ | |||
+ | int main() | ||
+ | { | ||
+ | for (int i = 0; i < 20; ++i) | ||
+ | silly_sleep_ms(50); | ||
+ | } | ||
+ | </ | ||
kennen/lib/duration_cast.txt · Zuletzt geändert: 2019-11-20 15:08 von 127.0.0.1