远程桌面优化
This commit is contained in:
@@ -40,3 +40,28 @@
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>C<EFBFBD><43><EFBFBD><EFBFBD>ʱ<EFBFBD>ȴ<EFBFBD>T<EFBFBD><54>(<28><><EFBFBD><EFBFBD>1ms)
|
||||
#define WAIT_1(C, T) { timeBeginPeriod(1); WAIT_n(C, T, 1); timeEndPeriod(1); }
|
||||
|
||||
#include <time.h>
|
||||
#include <stdio.h>
|
||||
|
||||
// <20><><EFBFBD>ܼ<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㺯<EFBFBD><E3BAAF><EFBFBD>ĺ<EFBFBD>ʱ
|
||||
class auto_tick
|
||||
{
|
||||
private:
|
||||
const char *func;
|
||||
int threshold;
|
||||
clock_t tick;
|
||||
__inline clock_t now() const { return clock(); }
|
||||
|
||||
public:
|
||||
auto_tick(const char *func_name, int th=5) : func(func_name), threshold(th), tick(now()) { }
|
||||
~auto_tick() {int s(this->time());if(s>threshold)printf("[%s]ִ<><D6B4>ʱ<EFBFBD><CAB1>: [%d]ms.\n", func, s);}
|
||||
__inline int time() const { return now() - tick; }
|
||||
};
|
||||
|
||||
#ifdef _DEBUG
|
||||
// <20><><EFBFBD>ܼ<EFBFBD><DCBC>㵱ǰ<E3B5B1><C7B0><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ӡ
|
||||
#define AUTO_TICK(thresh) auto_tick(__FUNCTION__, thresh)
|
||||
#else
|
||||
#define AUTO_TICK(thresh)
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user