debug.cpp
来自「ActiveX Setup Server Version 2.0.5 Chips」· C++ 代码 · 共 68 行
CPP
68 行
#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}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?