<ctime>

包含標準 C 連結庫標頭 <time.h> ,並將相關聯的名稱新增至 std 命名空間。

語法

#include <ctime>

備註

包含此標頭可保證,透過使用 Standard C 程式庫標頭中的外部連結所宣告的名稱會在 std 命名空間中宣告。

常數

#define NULL
#define CLOCKS_PER_SEC
#define TIME_UTC

namespace std {
    using size_t = see below;
    using clock_t = see below ;
    using time_t = see below ;
}

結構

struct timespec;
struct tm;

函式

clock_t clock();
double difftime(time_t time1, time_t time0);
time_t mktime(struct tm* timeptr);
time_t time(time_t* timer);
int timespec_get(timespec* ts, int base);
char* asctime(const struct tm* timeptr);
char* ctime(const time_t* timer);
struct tm* gmtime(const time_t* timer);
struct tm* localtime(const time_t* timer);
size_t strftime(char* s, size_t maxsize, const char* format, const struct tm* timeptr);

另請參閱

標頭檔參考
C++ 標準程式庫概觀
C++ 標準程式庫中的執行緒安全