관리/자료 구성
시간(Time, Date) 관련 Library
자연&사람
2019. 10. 4. 18:07
반응형
시간 관련 함수
localtime(3) - 초단위 시간을 지역시간 struct tm 타입으로 변환
localtime_r(3) - 지역시간 struct tm 타입으로 변환(thread-safe)
gettimeofday(2) - micro초단위의 시간 얻기
settimeofday(2) - 시스템 시간을 변경하기(micro초 단위)
gmtime(3) - 초단위의 시간을 국제표준시(UTC) struct tm으로 변환
gmtime_r(3) - 초단위의 시간을 국제표준시(UTC) struct tm으로 변환(thread-safe)
ctime_r(3) - 초단위 시간을 문자열로 변환(thread-safe)
asctime(3) - struct tm 구조체를 날짜 및 시간 표시 문자열로 변환
asctime_r(3) - struct tm 구조체를 날짜 및 시간 표시 문자열로 변환(thread-safe)
mktime(3) - struct tm를 time_t로 변환
strftime(3) - struct tm을 format된 문자열로 변환
strptime(3) - format된 문자열 시간을 struct tm으로 변환
Sleep 함수들
sleep(3) - 설정된 초(second) 동안 대기
usleep(3) - 설정된 micro초(microsecond: 100만분의 1초) 동안 대기
nanosleep(2) - 설정된 nano초(nanosecond: 10억분의 1초) 동안 대기
반응형