提交 d67d4d3f 编写于 作者: mysterywolf's avatar mysterywolf

add difftime()

上级 51cb109c
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
* 2021-02-08 Meco Man add settimeofday() stime() * 2021-02-08 Meco Man add settimeofday() stime()
* 2021-02-10 Meco Man add ctime_r() and re-implement ctime() * 2021-02-10 Meco Man add ctime_r() and re-implement ctime()
* 2021-02-11 Meco Man fix bug #3183 - align days[] and months[] to 4 bytes * 2021-02-11 Meco Man fix bug #3183 - align days[] and months[] to 4 bytes
* add difftime()
*/ */
#include <sys/time.h> #include <sys/time.h>
...@@ -163,6 +164,11 @@ char* ctime(const time_t *tim_p) ...@@ -163,6 +164,11 @@ char* ctime(const time_t *tim_p)
return asctime (localtime (tim_p)); return asctime (localtime (tim_p));
} }
double difftime (time_t tim1, time_t tim2)
{
return (double)(tim1 - tim2);
}
/** /**
* Returns the current time. * Returns the current time.
* *
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册