認識sprintf( ) 涵式 Function
認識 C 語言的 time( ) 涵式
認識 clock( ) 涵式
http://tw.gitbook.net/c_standard_library/c_function_clock.html
#include
#include
#include
char s[120], i = 0;
int main(int argc, char *argv[]) {
time_t t1 = time( NULL ), t2;
clock_t mS;
while ( 1 ) {
t2 = time( NULL ); //Get current time
mS = clock() ;
if ( t2 > t1 ) { //2=2Second
t1 = t2;
sprintf( s, "\n\r Hello d=%2X %ld", i, i, mS );
printf( s );
++i;
}
}
return 0;
}