common_util
Loading...
Searching...
No Matches
timecount.h
Go to the documentation of this file.
1
23#pragma once
24
25#include <cstdint>
26#include <atomic>
27#include <string>
28
29namespace cutl
30{
36 {
37 public:
43 timecount(const std::string &func_name);
49
50 private:
51 std::string func_name_;
52 std::atomic<uint64_t> start_time_;
53 };
54
55} // namespace
A simple time counter class to measure the execution time of a function.
Definition timecount.h:36
timecount(const std::string &func_name)
Construct a new timecount object The constructor will record the begin time of the function calling.
~timecount()
Destroy the timecount object The desctructor will record the end time of the function calling and cal...