summaryrefslogtreecommitdiff
path: root/examples/libc/time.c
diff options
context:
space:
mode:
author[email protected] <[email protected]>2010-11-18 11:31:54 +0000
committer[email protected] <[email protected]>2010-11-18 11:31:54 +0000
commitd9cb84f4840c49993cfbcc80057488c50eae60cb (patch)
tree9077055207bb6faa59cd565d37a77aa12e39b53c /examples/libc/time.c
parent019b6542012115190cfbde415532c8940cc47500 (diff)
add libc testcase.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1061 bbd45198-f89e-11dd-88c7-29a3b14d5316
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);