solve the time of a loop 0:100

Dependencies:   mbed

Fork of Timer_HelloWorld by mbed official

main.cpp

Committer:
shiyilei
Date:
2014-10-21
Revision:
2:c979a2f3b744
Parent:
0:27e1de20d3cb

File content as of revision 2:c979a2f3b744:

/**************************************
*file name: base time count
*Creator:JacobShi
*Time:2014/10/20
*Description: solve the time of a loop
 ***************************************/
#include "mbed.h"
Timer t;
int i;
int timedata;
int main(void)
{

    t.reset();
    t.start();
    for(i=0;i<100;i++);
    t.stop();
    timedata=t.read_us();
    printf("the time of the loos 0~99 is :%d us\n",timedata);
}