更新log.h

This commit is contained in:
xinyang
2019-08-14 12:00:33 +08:00
parent d56c698dbf
commit f6ddbc47d0

View File

@@ -24,6 +24,8 @@
// arguments: tag:显示代码块执行时间前的用户信息支持printf格式化字符串 // arguments: tag:显示代码块执行时间前的用户信息支持printf格式化字符串
// codes:需要被统计时间的代码块 // codes:需要被统计时间的代码块
// attention: 代码块内定义的局部变量作用域仅限于该代码块 // attention: 代码块内定义的局部变量作用域仅限于该代码块
// 代码块内不支持使用break,continue语句,将无法达到预想效果
// 支持多出口离开代码块都能显示代码块执行时间
// //
#ifndef _LOG_H_ #ifndef _LOG_H_
#define _LOG_H_ #define _LOG_H_
@@ -155,7 +157,7 @@
/******************** the time counter API ************************/ /******************** the time counter API ************************/
#if !defined(DO_NOT_CNT_TIME) && LOG_LEVEL > LOG_NONE #if !defined(DO_NOT_CNT_TIME) && LOG_LEVEL > LOG_NONE
#define CNT_TIME(tag, codes, ...) do{ \ #define CNT_TIME(tag, codes, ...) do{ \
class TimeCounter{ \ class { \
private: \ private: \
systime begin; \ systime begin; \
public: \ public: \