aboutsummaryrefslogtreecommitdiff
path: root/test/timer.cc
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2023-08-08 22:18:28 +0200
committerJohannes Stoelp <johannes.stoelp@gmail.com>2023-08-08 22:18:28 +0200
commit851d4fb9db087eeb183f1c1cb5d96829a32e690b (patch)
treeb7bcefc108ed310b6568cb10f728233833209ccc /test/timer.cc
parent005cd3b630fcf0f3870f426a0db5e54400a59ef9 (diff)
downloadcpp-utils-851d4fb9db087eeb183f1c1cb5d96829a32e690b.tar.gz
cpp-utils-851d4fb9db087eeb183f1c1cb5d96829a32e690b.zip
add clang-tidy and fix lints
Diffstat (limited to 'test/timer.cc')
-rw-r--r--test/timer.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/timer.cc b/test/timer.cc
index 078c4bb..6bc783c 100644
--- a/test/timer.cc
+++ b/test/timer.cc
@@ -3,26 +3,26 @@
#include <cstdio>
int main() {
- timer::timer T;
+ timer::timer t;
- const auto show_time = [&T]() {
- std::fprintf(stderr, "usec=%f msec=%f sec=%f\n", T.as_usec(), T.as_msec(),
- T.as_sec());
+ const auto kShowTime = [&t]() {
+ std::fprintf(stderr, "usec=%f msec=%f sec=%f\n", t.as_usec(), t.as_msec(),
+ t.as_sec());
};
{
puts("Sleep 100ms");
- timer::scoped_timer s{T};
+ timer::scoped_timer s{t};
usleep(100 * 1000);
}
- show_time();
+ kShowTime();
{
puts("Sleep 500ms");
- timer::scoped_timer s{T};
+ timer::scoped_timer s{t};
usleep(500 * 1000);
}
- show_time();
+ kShowTime();
return 0;
}