# cplusplus_timer **Repository Path**: raymondwong/cplusplus_timer ## Basic Information - **Project Name**: cplusplus_timer - **Description**: 在测试算法的时候用于计算程序总共耗费的时间 - **Primary Language**: C++ - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2014-09-22 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #cplusplus_timer ==== ###简介 当学习使用算法的时候,书中经常会循序渐进的给出多种算法
这些算法中有效率低的也有效率高的
但是空看代码去分析复杂度是十分不直观的
所以这里写了一个timer的c++类,用于计算程序的总共运行时间
==== ###使用方法 将timer.h头文件放到和你需要测试的程序在一个目录下
在测试程序中添加 ```c++ #include "timer.h" ``` 在程序主函数中申明一个timer对象 ```c++ Timer timer; ``` 在主程序运行结束后调用totalTime函数 ``` timer.totalTime(); ```