文章预览
说明: # 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开源工作室 版权归原作者所有,如有侵权,请联系删除 。 ▍ 推荐阅读 世界上最大的盗版网站,遇到麻烦了! 10岁男孩自学编程、设计电路,兼职挣了1万多! 弃用C语言!美国拟用AI将全部老旧代码换成Rust →点关注,不迷路←
………………………………