Я явно слишком глуп, чтобы использовать библиотеку C ++ 17 <chrono>
.Компилируя следующее ...
#include <chrono>
#include <iostream>
int main() {
using clock = std::chrono::steady_clock;
using duration = std::chrono::duration<double, std::chrono::seconds>;
using timepoint = std::chrono::time_point<clock, duration>;
timepoint t0 = clock::now();
for (int i = 0; i < 1000; i++) {
timepoint t = clock::now();
duration d = t-t0;
double seconds = d.count();
std::cout << seconds << std::endl;
}
}
Я получаю ...
/usr/include/c++/8/chrono:319:16: error: static assertion failed:
period must be a specialization of ratio
static_assert(__is_ratio<_Period>::value,
^~~~~~~~~~~~~~~~~~~
Есть идеи?