Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cons(3)

TIME(2)

NAME

time, nsec − time in seconds and nanoseconds since epoch

SYNOPSIS

­#include <u.h>
­#include <libc.h>

long time(long ∗tp)

vlong nsec(void)

DESCRIPTION

Both ­time and ­nsec return the time since the epoch 00:00:00 GMT, Jan. 1, 1970.  The return value of the former is in seconds and the latter in nanoseconds.  For time, if ­tp is not zero then ∗tp is also set to the answer. 

These functions work by reading /dev/bintime, opening that file when ­they are first called. 

SOURCE

­/sys/src/libc/9sys/time.c
­/sys/src/libc/9sys/nsec.c

SEE ALSO

cons(3)

DIAGNOSTICS

Sets errstr.

BUGS

These routines maintain a static file descriptor. 

Plan 9  —  March 02, 2002

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026