23 lines
485 B
C++
23 lines
485 B
C++
#include <iostream>
|
||
#include <Timer.h>
|
||
|
||
int main() {
|
||
{
|
||
ling::Timer timer([]() {
|
||
std::cout << "Hello World!" << std::endl;
|
||
});
|
||
timer.start(5);
|
||
getchar();
|
||
std::cout << "停止" << std::endl;
|
||
timer.stop();
|
||
getchar();
|
||
std::cout << "重新启动" << std::endl;
|
||
timer.start();
|
||
getchar();
|
||
}
|
||
std::cout << "释放" << std::endl;
|
||
getchar();
|
||
ling::Timer::stopAll();
|
||
return 0;
|
||
}
|