TIMER

hi guys,
is there a library in arduino that do the same as this one?

/* difftime example */
#include <stdio.h>
#include <time.h>

int main ()
{
time_t start,end;
char szInput [256];
double dif;

time (&start); /timer starts here/
printf ("Please, enter your name: ");
gets (szInput);
time (&end); /timer ends here/
dif = difftime (end,start);
printf (“Hi %s.\n”, szInput);
printf (“It took you %.2lf seconds to type your name.\n”, dif );

return 0;
}

what it does is it counts how fast you type your name…though i would not use the arduino to know how fast i can type my name i just thought that this would be helpful in future programming…THANKS! btw this is in C++

The millis() function returns the time that the Arduino has been running, in milliseconds. The micros() function returns the time that the Arduino has been running, in microseconds.

Call either one before and after an event. The difference between the two values is the time that the event took.