文章预览
说明: # include "xtime_l.h" //引用的头文件 XTime tend,tcur; u32 tused; XTime_GetTime( ); XTime_GetTime( ); tused=((tend-tcur)* 1000000 )/(COUNTS_PER_SECOND); printf ( "Time is %d us\r\n" ,tused); COUNTS_PER_SECOND: /* Global Timer is always clocked at half of the CPU frequency */ # define COUNTS_PER_SECOND (XPAR_CPU_CORTEXA9_CORE_CLOCK_FREQ_HZ /2) 应用实例: # include "xtime_l.h" # include "sleep.h" XTime tend,tcur; int main () { u32 tused; XTime_GetTime( ); usleep( 13 ); XTime_GetTime( ); tused=((tend-tcur)* 1000000 )/(COUNTS_PER_SECOND); printf ( "time is %d us\r\n" ,tused); } END 来源:FPGA开源工作室 版权归原作者所有,如有侵权,请联系删除 。 ▍ 推荐阅读 KEIL MDK v6价格公布...... 中国人竟然也能发明靠谱的编程语言! C/C++大限将至,美国强硬要求2026年前全面剔除! →点关注,不迷路←
………………………………