1 // -*- C++ -*- 2 //===---------------------------- ctime -----------------------------------===// 3 // 4 // The LLVM Compiler Infrastructure 5 // 6 // This file is dual licensed under the MIT and the University of Illinois Open 7 // Source Licenses. See LICENSE.TXT for details. 8 // 9 //===----------------------------------------------------------------------===// 10 11 #ifndef _LIBCPP_CTIME 12 #define _LIBCPP_CTIME 13 14 /* 15 ctime synopsis 16 17 Macros: 18 19 NULL 20 CLOCKS_PER_SEC 21 TIME_UTC // C++17 22 23 namespace std 24 { 25 26 Types: 27 28 clock_t 29 size_t 30 time_t 31 tm 32 timespec // C++17 33 34 clock_t clock(); 35 double difftime(time_t time1, time_t time0); 36 time_t mktime(tm* timeptr); 37 time_t time(time_t* timer); 38 char* asctime(const tm* timeptr); 39 char* ctime(const time_t* timer); 40 tm* gmtime(const time_t* timer); 41 tm* localtime(const time_t* timer); 42 size_t strftime(char* restrict s, size_t maxsize, const char* restrict format, 43 const tm* restrict timeptr); 44 int timespec_get( struct timespec *ts, int base); // C++17 45 } // std 46 47 */ 48 49 #include <__config> 50 #include <time.h> 51 52 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) 53 #pragma GCC system_header 54 #endif 55 56 _LIBCPP_BEGIN_NAMESPACE_STD 57 58 using ::clock_t; 59 using ::size_t; 60 using ::time_t; 61 using ::tm; 62 #if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_C11_FEATURES) 63 using ::timespec; 64 #endif 65 using ::clock; 66 using ::difftime; 67 using ::mktime; 68 using ::time; 69 #ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS 70 using ::asctime; 71 using ::ctime; 72 using ::gmtime; 73 using ::localtime; 74 #endif 75 using ::strftime; 76 #if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_TIMESPEC_GET) 77 using ::timespec_get; 78 #endif 79 80 _LIBCPP_END_NAMESPACE_STD 81 82 #endif // _LIBCPP_CTIME 83