time

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

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 added in v0.8.10

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

func ClockGettime added in v0.8.10

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

func ClockSettime added in v0.8.10

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

func Ctime added in v0.8.10

func Ctime(timer *TimeT) string

func Difftime added in v0.8.10

func Difftime(end, start TimeT) float64

func Strftime added in v0.8.10

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

Types

type ClockT added in v0.8.10

type ClockT C.clock_t

func Clock added in v0.8.10

func Clock() ClockT

type ClockidT added in v0.8.10

type ClockidT C.clockid_t

type TimeT added in v0.8.10

type TimeT C.time_t

func Mktime added in v0.8.10

func Mktime(timer *Tm) TimeT

func Time added in v0.8.10

func Time(timer *TimeT) TimeT

type Timespec

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

type Tm added in v0.8.10

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 added in v0.8.10

func Gmtime(timer *TimeT) *Tm

func Localtime added in v0.8.10

func Localtime(timer *TimeT) *Tm

Jump to

Keyboard shortcuts

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