type time.Duration
252 uses
time (current package)
format.go#L1589: func ParseDuration(s string) (Duration, error) {
format.go#L1680: return -Duration(d), nil
format.go#L1685: return Duration(d), nil
sleep.go#L9: func Sleep(d Duration)
sleep.go#L28: func when(d Duration) int64 {
sleep.go#L86: func NewTimer(d Duration) *Timer {
sleep.go#L134: func (t *Timer) Reset(d Duration) bool {
sleep.go#L156: func After(d Duration) <-chan Time {
sleep.go#L163: func AfterFunc(d Duration, f func()) *Timer {
tick.go#L20: func NewTicker(d Duration) *Ticker {
tick.go#L51: func (t *Ticker) Reset(d Duration) {
tick.go#L66: func Tick(d Duration) <-chan Time {
time.go#L612: type Duration int64
time.go#L615: minDuration Duration = -1 << 63
time.go#L616: maxDuration Duration = 1<<63 - 1
time.go#L632: Nanosecond Duration = 1
time.go#L644: func (d Duration) String() string {
time.go#L759: func (d Duration) Nanoseconds() int64 { return int64(d) }
time.go#L762: func (d Duration) Microseconds() int64 { return int64(d) / 1e3 }
time.go#L765: func (d Duration) Milliseconds() int64 { return int64(d) / 1e6 }
time.go#L777: func (d Duration) Seconds() float64 {
time.go#L784: func (d Duration) Minutes() float64 {
time.go#L791: func (d Duration) Hours() float64 {
time.go#L799: func (d Duration) Truncate(m Duration) Duration {
time.go#L808: func lessThanHalf(x, y Duration) bool {
time.go#L818: func (d Duration) Round(m Duration) Duration {
time.go#L844: func (d Duration) Abs() Duration {
time.go#L856: func (t Time) Add(d Duration) Time {
time.go#L884: func (t Time) Sub(u Time) Duration {
time.go#L888: d := Duration(te - ue)
time.go#L897: d := Duration(t.sec()-u.sec())*Second + Duration(t.nsec()-u.nsec())
time.go#L911: func Since(t Time) Duration {
time.go#L924: func Until(t Time) Duration {
time.go#L1528: func (t Time) Truncate(d Duration) Time {
time.go#L1545: func (t Time) Round(d Duration) Time {
time.go#L1560: func div(t Time, d Duration) (qmod2 int, r Duration) {
time.go#L1579: r = Duration(nsec % int32(d))
time.go#L1585: r = Duration(sec%d1)*Second + Duration(nsec)
time.go#L1632: r = Duration(u0)
context
context.go#L684: func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) {
context.go#L691: func WithTimeoutCause(parent Context, timeout time.Duration, cause error) (Context, CancelFunc) {
crypto/tls
handshake_client_tls13.go#L736: lifetime := time.Duration(msg.lifetime) * time.Second
flag
flag.go#L278: type durationValue time.Duration
flag.go#L280: func newDurationValue(val time.Duration, p *time.Duration) *durationValue {
flag.go#L294: func (d *durationValue) Get() any { return time.Duration(*d) }
flag.go#L296: func (d *durationValue) String() string { return (*time.Duration)(d).String() }
flag.go#L931: func (f *FlagSet) DurationVar(p *time.Duration, name string, value time.Duration, usage string) {
flag.go#L938: func DurationVar(p *time.Duration, name string, value time.Duration, usage string) {
flag.go#L945: func (f *FlagSet) Duration(name string, value time.Duration, usage string) *time.Duration {
flag.go#L946: p := new(time.Duration)
flag.go#L954: func Duration(name string, value time.Duration, usage string) *time.Duration {
github.com/cenkalti/backoff/v4
backoff.go#L29: NextBackOff() time.Duration
backoff.go#L36: const Stop time.Duration = -1
backoff.go#L44: func (b *ZeroBackOff) NextBackOff() time.Duration { return 0 }
backoff.go#L52: func (b *StopBackOff) NextBackOff() time.Duration { return Stop }
backoff.go#L58: Interval time.Duration
backoff.go#L62: func (b *ConstantBackOff) NextBackOff() time.Duration { return b.Interval }
backoff.go#L64: func NewConstantBackOff(d time.Duration) *ConstantBackOff {
context.go#L55: func (b *backOffContext) NextBackOff() time.Duration {
exponential.go#L55: InitialInterval time.Duration
exponential.go#L58: MaxInterval time.Duration
exponential.go#L61: MaxElapsedTime time.Duration
exponential.go#L62: Stop time.Duration
exponential.go#L65: currentInterval time.Duration
exponential.go#L116: func (b *ExponentialBackOff) NextBackOff() time.Duration {
exponential.go#L133: func (b *ExponentialBackOff) GetElapsedTime() time.Duration {
exponential.go#L143: b.currentInterval = time.Duration(float64(b.currentInterval) * b.Multiplier)
exponential.go#L149: func getRandomValueFromInterval(randomizationFactor, random float64, currentInterval time.Duration) time.Duration {
exponential.go#L160: return time.Duration(minInterval + (random * (maxInterval - minInterval + 1)))
retry.go#L27: type Notify func(error, time.Duration)
retry.go#L73: next time.Duration
timer.go#L6: Start(duration time.Duration)
timer.go#L22: func (t *defaultTimer) Start(duration time.Duration) {
tries.go#L22: func (b *backOffTries) NextBackOff() time.Duration {
github.com/gotd/neo
ticker.go#L11: dur time.Duration
ticker.go#L22: func (t *ticker) Reset(d time.Duration) {
time.go#L13: Reset(d time.Duration)
time.go#L20: Reset(d time.Duration)
time.go#L45: func (t *Time) Timer(d time.Duration) Timer {
time.go#L54: func (t *Time) Ticker(d time.Duration) Ticker {
time.go#L96: func (t *Time) reset(d time.Duration, id int, do func(now time.Time), durp *time.Duration) {
time.go#L103: func (t *Time) resetUnlocked(d time.Duration, id int, do func(now time.Time), durp *time.Duration) {
time.go#L152: func (t *Time) Travel(d time.Duration) time.Time {
time.go#L179: func (t *Time) Sleep(d time.Duration) { <-t.After(d) }
time.go#L182: func (t *Time) When(d time.Duration) time.Time {
time.go#L188: func (t *Time) After(d time.Duration) <-chan time.Time {
timer.go#L19: func (t *timer) Reset(d time.Duration) {
github.com/gotd/td/clock
clock.go#L13: Timer(d time.Duration) Timer
clock.go#L14: Ticker(d time.Duration) Ticker
system.go#L13: func (s systemTimer) Reset(d time.Duration) {
system.go#L33: func (s systemTicker) Reset(d time.Duration) {
system.go#L39: func (clock systemClock) Ticker(d time.Duration) Ticker {
system.go#L43: func (systemClock) Timer(d time.Duration) Timer {
github.com/gotd/td/internal/exchange
flow.go#L27: timeout time.Duration
flow.go#L50: func (e Exchanger) WithTimeout(timeout time.Duration) Exchanger {
proto.go#L19: timeout time.Duration
github.com/gotd/td/internal/mtproto
conn.go#L88: ackInterval time.Duration
conn.go#L95: pingTimeout time.Duration
conn.go#L97: pingInterval time.Duration
conn.go#L108: dialTimeout time.Duration
conn.go#L109: exchangeTimeout time.Duration
conn.go#L110: saltFetchInterval time.Duration
conn.go#L111: getTimeout func(req uint32) time.Duration
options.go#L40: AckInterval time.Duration
options.go#L43: RetryInterval time.Duration
options.go#L48: DialTimeout time.Duration
options.go#L50: ExchangeTimeout time.Duration
options.go#L52: SaltFetchInterval time.Duration
options.go#L54: PingTimeout time.Duration
options.go#L56: PingInterval time.Duration
options.go#L58: RequestTimeout func(req uint32) time.Duration
options.go#L140: opt.RequestTimeout = func(req uint32) time.Duration {
github.com/gotd/td/internal/rpc
engine.go#L27: retryInterval time.Duration
options.go#L13: RetryInterval time.Duration
github.com/gotd/td/internal/tdsync
backoff.go#L15: func (s *syncBackoff) NextBackOff() time.Duration {
github.com/gotd/td/telegram
client.go#L62: migrationTimeout time.Duration // immutable
connect.go#L74: }, b, func(err error, timeout time.Duration) {
options.go#L52: MigrationTimeout time.Duration
options.go#L72: AckInterval time.Duration
options.go#L74: RetryInterval time.Duration
options.go#L78: ExchangeTimeout time.Duration
options.go#L80: DialTimeout time.Duration
github.com/gotd/td/telegram/auth
password.go#L138: func (r ResetFailedWaitError) Until() time.Duration {
github.com/gotd/td/telegram/auth/qrlogin
qrlogin.go#L142: until := func(token Token) time.Duration {
github.com/gotd/td/telegram/internal/manager
conn.go#L225: }, c.connBackoff(ctx), func(err error, duration time.Duration) {
github.com/gotd/td/tgerr
flood_wait.go#L18: func AsFloodWait(err error) (d time.Duration, ok bool) {
flood_wait.go#L20: return time.Second * time.Duration(rpcErr.Argument), true
go.uber.org/atomic
duration.go#L37: var _zeroDuration time.Duration
duration.go#L40: func NewDuration(val time.Duration) *Duration {
duration.go#L49: func (x *Duration) Load() time.Duration {
duration.go#L50: return time.Duration(x.v.Load())
duration.go#L54: func (x *Duration) Store(val time.Duration) {
duration.go#L61: func (x *Duration) CAS(old, new time.Duration) (swapped bool) {
duration.go#L66: func (x *Duration) CompareAndSwap(old, new time.Duration) (swapped bool) {
duration.go#L72: func (x *Duration) Swap(val time.Duration) (old time.Duration) {
duration.go#L73: return time.Duration(x.v.Swap(int64(val)))
duration.go#L83: var v time.Duration
duration_ext.go#L28: func (d *Duration) Add(delta time.Duration) time.Duration {
duration_ext.go#L29: return time.Duration(d.v.Add(int64(delta)))
duration_ext.go#L33: func (d *Duration) Sub(delta time.Duration) time.Duration {
duration_ext.go#L34: return time.Duration(d.v.Sub(int64(delta)))
go.uber.org/zap
array.go#L59: func Durations(key string, ds []time.Duration) Field {
array.go#L305: type durations []time.Duration
field.go#L383: func Duration(key string, val time.Duration) Field {
field.go#L389: func Durationp(key string, val *time.Duration) Field {
field.go#L596: case time.Duration:
field.go#L597: c = anyFieldC[time.Duration](Duration)
field.go#L598: case *time.Duration:
field.go#L599: c = anyFieldC[*time.Duration](Durationp)
field.go#L600: case []time.Duration:
field.go#L601: c = anyFieldC[[]time.Duration](Durations)
go.uber.org/zap/zapcore
buffered_write_syncer.go#L94: FlushInterval time.Duration
clock.go#L36: NewTicker(time.Duration) *time.Ticker
clock.go#L46: func (systemClock) NewTicker(duration time.Duration) *time.Ticker {
encoder.go#L222: type DurationEncoder func(time.Duration, PrimitiveArrayEncoder)
encoder.go#L225: func SecondsDurationEncoder(d time.Duration, enc PrimitiveArrayEncoder) {
encoder.go#L231: func NanosDurationEncoder(d time.Duration, enc PrimitiveArrayEncoder) {
encoder.go#L237: func MillisDurationEncoder(d time.Duration, enc PrimitiveArrayEncoder) {
encoder.go#L243: func StringDurationEncoder(d time.Duration, enc PrimitiveArrayEncoder) {
encoder.go#L360: AddDuration(key string, value time.Duration)
encoder.go#L395: AppendDuration(time.Duration)
field.go#L135: enc.AddDuration(f.Key, time.Duration(f.Integer))
json_encoder.go#L134: func (enc *jsonEncoder) AddDuration(key string, val time.Duration) {
json_encoder.go#L265: func (enc *jsonEncoder) AppendDuration(val time.Duration) {
memory_encoder.go#L69: func (m MapObjectEncoder) AddDuration(k string, v time.Duration) { m.cur[k] = v }
memory_encoder.go#L164: func (s *sliceArrayEncoder) AppendDuration(v time.Duration) { s.elems = append(s.elems, v) }
sampler.go#L64: func (c *counter) IncCheckReset(t time.Time, tick time.Duration) uint64 {
sampler.go#L152: func NewSamplerWithOptions(core Core, tick time.Duration, first, thereafter int, opts ...SamplerOption) Core {
sampler.go#L172: tick time.Duration
sampler.go#L195: func NewSampler(core Core, tick time.Duration, first, thereafter int) Core {
net
dial.go#L83: Timeout time.Duration
dial.go#L114: FallbackDelay time.Duration
dial.go#L123: KeepAlive time.Duration
dial.go#L207: timeout := timeRemaining / time.Duration(addrsRemaining)
dial.go#L220: func (d *Dialer) fallbackDelay() time.Duration {
dial.go#L413: func DialTimeout(network, address string, timeout time.Duration) (Conn, error) {
dial.go#L685: KeepAlive time.Duration
dnsclient_unix.go#L161: func (r *Resolver) exchange(ctx context.Context, server string, q dnsmessage.Question, timeout time.Duration, useTCP, ad bool) (dnsmessage.Parser, dnsmessage.Header, error) {
dnsconfig.go#L22: timeout time.Duration // wait before giving up on a query, including retries
dnsconfig_unix.go#L91: conf.timeout = time.Duration(n) * time.Second
hook.go#L25: testHookSetKeepAlive = func(time.Duration) {}
tcpsock.go#L198: func (c *TCPConn) SetKeepAlivePeriod(d time.Duration) error {
tcpsock.go#L238: func newTCPConn(fd *netFD, keepAlive time.Duration, keepAliveHook func(time.Duration)) *TCPConn {
tcpsock.go#L396: func roundDurationUp(d time.Duration, to time.Duration) time.Duration {
tcpsockopt_unix.go#L15: func setKeepAlivePeriod(fd *netFD, d time.Duration) error {
net/http
client.go#L106: Timeout time.Duration
h2_bundle.go#L3939: IdleTimeout time.Duration
h2_bundle.go#L5254: func (sc *http2serverConn) shutDownIn(d time.Duration) {
h2_bundle.go#L7239: ReadIdleTimeout time.Duration
h2_bundle.go#L7244: PingTimeout time.Duration
h2_bundle.go#L7249: WriteByteTimeout time.Duration
h2_bundle.go#L7293: func (t *http2Transport) pingTimeout() time.Duration {
h2_bundle.go#L7388: idleTimeout time.Duration // or 0 for never
h2_bundle.go#L7540: timeout time.Duration
h2_bundle.go#L7625: var http2retryBackoffHook func(time.Duration) *time.Timer
h2_bundle.go#L7627: func http2backoffNewTimer(d time.Duration) *time.Timer {
h2_bundle.go#L7660: d := time.Second * time.Duration(backoff)
h2_bundle.go#L7798: func (t *http2Transport) expectContinueTimeout() time.Duration {
h2_bundle.go#L8250: func (cc *http2ClientConn) responseHeaderTimeout() time.Duration {
h2_bundle.go#L10210: func (t *http2Transport) idleConnTimeout() time.Duration {
server.go#L884: func (srv *Server) tlsHandshakeTimeout() time.Duration {
server.go#L885: var ret time.Duration
server.go#L886: for _, v := range [...]time.Duration{
server.go#L2647: ReadTimeout time.Duration
server.go#L2655: ReadHeaderTimeout time.Duration
server.go#L2662: WriteTimeout time.Duration
server.go#L2668: IdleTimeout time.Duration
server.go#L2798: nextPollInterval := func() time.Duration {
server.go#L2800: interval := pollIntervalBase + time.Duration(rand.Intn(int(pollIntervalBase/10)))
server.go#L3052: var tempDelay time.Duration // how long to sleep on accept failure
server.go#L3171: func (s *Server) idleTimeout() time.Duration {
server.go#L3178: func (s *Server) readHeaderTimeout() time.Duration {
server.go#L3347: func TimeoutHandler(h Handler, dt time.Duration, msg string) Handler {
server.go#L3362: dt time.Duration
transport.go#L178: TLSHandshakeTimeout time.Duration
transport.go#L217: IdleConnTimeout time.Duration
transport.go#L223: ResponseHeaderTimeout time.Duration
transport.go#L232: ExpectContinueTimeout time.Duration
net/http/httptrace
trace.go#L254: IdleTime time.Duration
os
exec.go#L144: func (p *ProcessState) UserTime() time.Duration {
exec.go#L149: func (p *ProcessState) SystemTime() time.Duration {
exec_unix.go#L100: func (p *ProcessState) userTime() time.Duration {
exec_unix.go#L101: return time.Duration(p.rusage.Utime.Nano()) * time.Nanosecond
exec_unix.go#L104: func (p *ProcessState) systemTime() time.Duration {
exec_unix.go#L105: return time.Duration(p.rusage.Stime.Nano()) * time.Nanosecond
runtime/debug
garbage.go#L17: PauseTotal time.Duration // total pause for all collections
garbage.go#L18: Pause []time.Duration // pause history, most recent first
garbage.go#L20: PauseQuantiles []time.Duration
garbage.go#L39: stats.Pause = make([]time.Duration, 2*maxPause+3)
stubs.go#L12: func readGCStats(*[]time.Duration)
|
The pages are generated with Golds v0.6.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |