summaryrefslogtreecommitdiff
path: root/examples/libc/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/libc/time.c')
-rw-r--r--examples/libc/time.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/examples/libc/time.c b/examples/libc/time.c
new file mode 100644
index 0000000000..cbe5773ec0
--- /dev/null
+++ b/examples/libc/time.c
@@ -0,0 +1,24 @@
+/*
+ * time.c
+ *
+ * Created on: 2010-11-17
+ * Author: bernard
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <finsh.h>
+
+int speed()
+{
+ int i;
+ time_t t;
+
+ printf("%d\n", time(0));
+ for (i = 0; i < 10000000; ++i)
+ t = time(0);
+
+ printf("%d\n", time(0));
+ return 0;
+}
+FINSH_FUNCTION_EXPORT(speed, speed test);