1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
struct tm { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_wday; int tm_isdst; };
time_t;
clock_t;
struct timespce{ time_t tv_sec; long tv_nsec; };
time_t time(time_t *calptr); double (time_t time_end, time_t time_beg);
* format conversions */ char* asctime( const struct tm *time_ptr); char* ctime(const time_t *time); struct tm *gmtime(const time_t *time); struct tm *localtime(const time_t *time); time_t mktime(struct tm *time);
size_t strftime(char *str, size_t count, const char *format, const struct tm *time); char *strptime(const char *s, const char *format, struct tm *tm);
#include <sys/time.h>
clockid_t : CLOCK_REALTIME: 实时系统时间 CLOCK_MONOTONIC: 不带负跳数的实时系统时间 CLOCK_PROCESS_CPUTIME_ID: 调用进程CPU时间 CLOCK_THREAD_CPUTIME_ID: 调用线程CPU时间 */ int clock_gettime(clockid_t clock_id, struct timespec *tsp); int clock_getres(clockid_t clock_id, struct timespec *tsp);
int clock_settime(clockid_t clodk_id, const struct timespec *tsp); int gettimeofday(struct timeval *restrict tp, void *restrict tzp);
|
近期评论