?? clock.c
字號:
/**************************************************************************
** *
** FILE : clock.c *
** *
** DESCRIPTION : The clock function returns the current processor time. *
** To determine the time in seconds, the value returned *
** by the clock function should be divided by the value *
** of the macro CLOCKS_PER_SEC, defined in <time.h>. *
** *
2001-2003 Altium BV
** *
**************************************************************************/
#include <time.h>
/* The _clock() function is used by CrossView to simulate a timer tick register. */
/* This function must have 'extern' scope, to allow the simulator to set a breakpoint. */
clock_t _clock ( clock_t t )
{
clock_t cycles;
__asm( "clk_loop:\n"
" mfc0 $a0,$4\n"
" mfc0 %0.1,$3\n"
" mfc0 %0.0,$4\n"
" bne %0.0,$a0,clk_loop\n" : "=R"(cycles) :: "$a0" );
return cycles;
}
clock_t clock ( void )
{
return _clock( (clock_t)-1 );
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -