?? 時(shí)間標(biāo)記服務(wù)(有問題).txt
字號(hào):
#include <stdio.h>
#include "system.h"
#include "alt_types.h"
#include "sys/alt_timestamp.h" //時(shí)間標(biāo)記服務(wù)頭文件
void func1(void)
{
int cnt=10000;
while(cnt--);
}
int main()
{
alt_u32 time1,time2;
if(alt_timestamp_start()<0)//開啟時(shí)間標(biāo)記服務(wù)
{
printf("cant statr timestmp\n");
}
time1=alt_timestamp();
func1();
time2=alt_timestamp();
printf("func1 need %u\n",(unsigned int)(time2-time1));
//測(cè)系統(tǒng)的頻率
printf("the freq of timer is %u\n",(unsigned int)alt_timestamp_freq());
return(0);
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -