2013-01-08 21:05:02 +08:00
|
|
|
/*
|
|
|
|
* time.c
|
|
|
|
*
|
|
|
|
* Created on: 2010-11-17
|
|
|
|
* Author: bernard
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <finsh.h>
|
|
|
|
|
|
|
|
int speed()
|
|
|
|
{
|
2021-03-07 08:34:04 +08:00
|
|
|
int i;
|
|
|
|
time_t t;
|
2013-01-08 21:05:02 +08:00
|
|
|
|
2021-03-07 08:34:04 +08:00
|
|
|
printf("%d\n", time(0));
|
|
|
|
for (i = 0; i < 10000000; ++i)
|
|
|
|
t = time(0);
|
2013-01-08 21:05:02 +08:00
|
|
|
|
2021-03-07 08:34:04 +08:00
|
|
|
printf("%d\n", time(0));
|
|
|
|
return 0;
|
2013-01-08 21:05:02 +08:00
|
|
|
}
|
|
|
|
FINSH_FUNCTION_EXPORT(speed, speed test);
|