mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-02-22 19:48:56 +08:00
add difftime()
This commit is contained in:
parent
51cb109cf8
commit
d67d4d3fd0
@ -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)
|
|||||||
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.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user