这个计时器应该是最准的
运用系统时间改变判断时间
新增了关机系统,重启,但重启不可用,因该是win11的问题
上代码
#include<windows.h>
#include<bits/stdc++.h>
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
using namespace std;
bool tomc=false;int jishirenwu;
int of_time;int p;int ffpti_h;int ffpti_m;int ffpti_s;int ff1;int ff2; int ff3;
bool timecout(){time_t timep;struct tm *tp;time(&timep);tp=localtime(&timep); p=tp->tm_sec;
if(of_time!=p){of_time=p;return false;}else{return true;}}
int timetoc(bool a){
if(ffpti_h==0&&ffpti_m==0&&ffpti_s==0){
system("cls");
Sleep(250);
system("color 04");
cout<<"-------------剩余时间-------------"<<endl<<endl;
cout<<" "<<"0"<<":"<<"0"<<":"<<"0"<<endl<&l