我想从Stopwatch类测试restart()方法,类的一部分如下所示:
class Stopwatch {
public:
Stopwatch();
void start();
void restart(); // stopwatch reset and start
...
uint64_t getTime() const; // gets the running time of the stopwatch in nanoseconds
private:
...
};如何捕获重新启动()后重置为0的时间?我相信一定有一种更简单的方法,比如在unist.h中睡觉。
发布于 2021-04-12 18:14:16
我用了“某个程序员”的解决方案
https://stackoverflow.com/questions/67010171
复制相似问题