Help us shape the future of Go! Take the 2026 Go Developer Survey

time

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2026 License: Apache-2.0 Imports: 3 Imported by: 6

Documentation

Index

Constants

View Source
const (
	// the system's real time (i.e. wall time) clock, expressed as the amount of time since the Epoch.
	// This is the same as the value returned by gettimeofday
	CLOCK_REALTIME = ClockidT(C.CLOCK_REALTIME)

	// clock that increments monotonically, tracking the time since an arbitrary point, and will continue
	// to increment while the system is asleep.
	CLOCK_MONOTONIC = ClockidT(C.CLOCK_MONOTONIC)

	// clock that increments monotonically, tracking the time since an arbitrary point like CLOCK_MONOTONIC.
	// However, this clock is unaffected by frequency or time adjustments.  It should not be compared to
	// other system time sources.
	CLOCK_MONOTONIC_RAW = ClockidT(C.CLOCK_MONOTONIC_RAW)

	// clock that tracks the amount of CPU (in user- or kernel-mode) used by the calling process.
	CLOCK_PROCESS_CPUTIME_ID = ClockidT(C.CLOCK_PROCESS_CPUTIME_ID)

	// clock that tracks the amount of CPU (in user- or kernel-mode) used by the calling thread.
	CLOCK_THREAD_CPUTIME_ID = ClockidT(C.CLOCK_THREAD_CPUTIME_ID)
)
View Source
const (
	LLGoPackage = "decl"
)

Variables

This section is empty.

Functions

func ClockGetres

func ClockGetres(clkId ClockidT, res *Timespec) c.Int

func ClockGettime

func ClockGettime(clkId ClockidT, tp *Timespec) c.Int

func ClockSettime

func ClockSettime(clkId ClockidT, tp *Timespec) c.Int

func Ctime

func Ctime(timer *TimeT) *c.Char

func Difftime

func Difftime(end, start TimeT) float64

func Strftime

func Strftime(buf *c.Char, bufSize uintptr, format *c.Char, timeptr *Tm) uintptr

Types

type ClockT

type ClockT C.clock_t

func Clock

func Clock() ClockT

type ClockidT

type ClockidT C.clockid_t

type TimeT

type TimeT C.time_t

func Mktime

func Mktime(timer *Tm) TimeT

func Time

func Time(timer *TimeT) TimeT

type Timespec

type Timespec struct {
	Sec  TimeT  // seconds
	Nsec c.Long // and nanoseconds
}

type Tm

type Tm struct {
	Sec    c.Int
	Min    c.Int
	Hour   c.Int
	Mday   c.Int
	Mon    c.Int
	Year   c.Int
	Wday   c.Int
	Yday   c.Int
	Isdst  c.Int
	Gmtoff c.Long
	Zone   *c.Char
}

func Gmtime

func Gmtime(timer *TimeT) *Tm

func Localtime

func Localtime(timer *TimeT) *Tm

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL