POSIX:sys/times
lastmod 2026-11-10created 2015-08-292 edits
sys/times.h is a POSIX header that declares the times() function and struct tms, which report the CPU time used by a process and its child processes. It returns user-mode and kernel-mode time in clock ticks; if you need wall-clock time, use gettimeofday() from the similarly named sys/time.h. Neither header exists in Visual C++ on Windows, so when porting you have to write replacements using GetSystemTimeAsFileTime and the like.