当前位置: 代码迷 >> 综合 >> 基于xilinx zynq 计算软件运行时间
  详细解决方案

基于xilinx zynq 计算软件运行时间

热度:25   发布时间:2024-01-06 05:17:53.0
#include "xtime_l.h"/* Global Timer is always clocked at half of the CPU frequency */
#define COUNTS_PER_SECOND (XPAR_CPU_CORTEXA9_CORE_CLOCK_FREQ_HZ / 2)int main() {
    XTime tEnd, tCur;u32 tUsed;XTime_GetTime(&tCur);		//获取开始时间sleep(1);				//XTime_GetTime(&tEnd);		//获取结束时间tUsed = ((tEnd-tCur)*1000000)/(COUNTS_PER_SECOND); //计算得到计时usprintf("time elapsed is %d us\r\n",tUsed); return 0;}