This commit is contained in:
Nick Fisher
2023-04-19 18:06:48 +08:00
parent 7f4ca7e69b
commit a162ff2400
30 changed files with 3604 additions and 2293 deletions

32
ios/include/TimeIt.hpp Normal file
View File

@@ -0,0 +1,32 @@
#ifndef TIMEIT_H_
#define TIMEIT_H_
#pragma once
#if __cplusplus <= 199711L
#include <ctime>
#else
#include <chrono>
#endif
class Timer
{
public:
Timer() { reset(); }
void reset();
double elapsed();
private:
#if __cplusplus <= 199711L
timespec beg_, end_;
#else
typedef std::chrono::high_resolution_clock clock_;
typedef std::chrono::duration<double, std::ratio<1> > second_;
std::chrono::time_point<clock_> beg_;
#endif
};
#endif // TIMEIT_H_