mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
format as milliseconds
This commit is contained in:
parent
ba54f9eaa3
commit
808765ea39
|
@ -62,7 +62,7 @@ void writer(int cols, int rows)
|
||||||
void timer(std::function<void(int, int)> fn, int cols, int rows)
|
void timer(std::function<void(int, int)> fn, int cols, int rows)
|
||||||
{
|
{
|
||||||
const auto repeat = std::size_t(3);
|
const auto repeat = std::size_t(3);
|
||||||
std::chrono::duration<double> time{};
|
std::chrono::duration<double, std::milli> time{};
|
||||||
std::cout << cols << " cols " << rows << " rows" << std::endl;
|
std::cout << cols << " cols " << rows << " rows" << std::endl;
|
||||||
fn(rows, cols); // 1 cold run
|
fn(rows, cols); // 1 cold run
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ void timer(std::function<void(int, int)> fn, int cols, int rows)
|
||||||
time += std::chrono::high_resolution_clock::now() - start;
|
time += std::chrono::high_resolution_clock::now() - start;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << time.count() / repeat << " seconds per iteration" << '\n' << '\n';
|
std::cout << time.count() / repeat << " ms per iteration" << '\n' << '\n';
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
Loading…
Reference in New Issue
Block a user