common_util
Loading...
Searching...
No Matches
Classes
timecount.h File Reference

A simple time counter class to measure the execution time of a function. More...

#include <cstdint>
#include <atomic>
#include <string>

Go to the source code of this file.

Classes

class  cutl::timecount
 A simple time counter class to measure the execution time of a function. More...
 

Detailed Description

A simple time counter class to measure the execution time of a function.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations.

Measure the execution time of a function by using the feature that a class instance object automatically destructs when it exits it's scope.

The time precision is microsecond,use monotone increment time, which presents the duration time between the system start time and the current time.

Author
spencer.luo
Date
2024-05-13