?? debug.cpp
字號(hào):
#include <stdio.h>#include <errno.h>#include "debug.h"#include "def.h"#ifdef DEBUG#include <iostream.h>//#define TIME#endif#ifdef TIME#include <sys/time.h>struct timeval start;struct timeval end;long sec;long usec;#endifvoid OutputRunTime(char *pszInstruction){#ifdef TIME gettimeofday(&end, NULL); if(end.tv_usec < start.tv_usec){ end.tv_sec -= 1; end.tv_usec += 1000000; } cout << pszInstruction << end.tv_sec - start.tv_sec << "." << end.tv_usec - start.tv_usec << "sec" << endl; gettimeofday(&start, NULL);#endif}void InitTime(){#ifdef TIME memset(&start, 0, sizeof(start)); memset(&end, 0, sizeof(end));#endif}void OutputDebugString(char *pszString, char *pszString2, char *pszString3){#ifdef DEBUG cout << pszString << pszString2 << pszString3 << endl;#endif}void OutputDebugString(int iValue, char *pszString2, char *pszString3){#ifdef DEBUG cout << iValue << pszString2 << pszString3 << endl;#endif}void OutputDebugString(char *pszString, int iValue, char *pszString3){#ifdef DEBUG cout << pszString << iValue << pszString3 << endl;#endif}void Perror(char * szString){#ifdef DEBUG perror(szString);#endif}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -