April 2020
Intermediate to advanced
412 pages
9h 58m
English
We are going to create a simple application that creates three time points and compares them to each other.
#include <iostream>#include <chrono>using namespace std::chrono_literals;int main() { auto a = std::chrono::system_clock::now(); auto b = a + 1s; auto c = a + 200ms; std::cout << "a < b ? " << (a < b ? "yes" : "no") << std::endl; std::cout << "a < c ? " << (a < c ? "yes" : "no") << std::endl; std::cout << "b < c ? " << (b < c ? "yes" : "no") << std::endl; return 0;}