分类: 嵌入式
2009-08-10 11:28:49
int tm_sec; /* seconds after the minute [0,61] */
int tm_min; /* minutes after the hour [0,59] */
int tm_hour; /* hours after midnight [0,23] */
int tm_mday; /* day of the month [1,31] */
int tm_mon; /* months since January [0,11] */
int tm_year; /* years since 1900 */
int tm_wday; /* days since Sunday [0, 6] */
int tm_yday; /* days since January 1st [0,365] */
int tm_isdst; /* Daylight Saving flag */
};
注意:这种 struct tm执行既不支持 the Daylight Saving flag(不明白什么意思,望后来研究者解释) ,也不支持时区。所有的数据都是格林威治时间。
这个头文件通过设置宏CLOCKS_PER_SEC 来表示每秒中系统的周期数,当然这个宏也可以用于把clock_t转换为秒,一般是用浮点除法把它计算成秒。
这里提醒各位由于处理器的运算速度往往是细小并呈微动态的,所以定义这个宏的值必须通过大量实验的验证。
在Blackfin处理器,以下方法可以用于定义宏。
1、通过 -DCLOCKS_PER_SEC=
2、通过系统服务库
3、在DSP设置选项Compile\Processor (1) \Processor speed
4、使用 cycles.h来实现。