精准计时器,还用Sleep吗?

这个计时器应该是最准的

运用系统时间改变判断时间

新增了关机系统,重启,但重启不可用,因该是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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值