GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
TIMESPEC_GET(3) FreeBSD Library Functions Manual TIMESPEC_GET(3)

timespec_get
get current calendar time

Standard C Library (libc, -lc)

#include <time.h>

int
timespec_get(struct timespec *ts, int base);

The timespec_get function sets the interval pointed to by ts to hold the current calendar time based on the specified time base in base.

The base TIME_UTC returns the time since the epoch. This time is expressed in seconds and nanoseconds since midnight (0 hour), January 1, 1970. In FreeBSD, this corresponds to CLOCK_REALTIME.

The timespec_get function returns the passed value of base if successful, otherwise 0 on failure.

clock_gettime(2), gettimeofday(2), time(3)

The timespec_get function with a base of TIME_UTC conforms to ISO/IEC 9899:2011 (“ISO C11”).

This interface first appeared in FreeBSD 12.

Kamil Rytarowski <kamil@NetBSD.org>
Warner Losh <imp@FreeBSD.org>
August 10, 2018 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.