Documentation
¶
Overview ¶
Package timet is time package template collection.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func H ¶
H returns n hour duration.
This is the same as "n * time.Hour".
Example ¶
d := H(1) fmt.Println(d) fmt.Println(d == 1*time.Hour)
Output: 1h0m0s true
func M ¶
M returns n minute duration.
This is the same as "n * time.Minute".
Example ¶
d := M(1) fmt.Println(d) fmt.Println(d == 1*time.Minute)
Output: 1m0s true
func MS ¶
MS returns n millisecond duration.
This is the same as "n * time.Millisecond".
Example ¶
d := MS(1) fmt.Println(d) fmt.Println(d == 1*time.Millisecond)
Output: 1ms true
func NS ¶
NS returns n nanosecond duration.
This is the same as "n * time.Nanosecond".
Example ¶
d := NS(1) fmt.Println(d) fmt.Println(d == 1*time.Nanosecond)
Output: 1ns true
Types ¶
type ElapsedTime ¶
ElapsedTime represents an active elapsed time instance.
func (*ElapsedTime) Elapsed ¶
func (s *ElapsedTime) Elapsed() time.Duration
Elapsed returns elapsed time.
func (*ElapsedTime) MarshalJSON ¶
func (s *ElapsedTime) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface.
func (*ElapsedTime) String ¶
func (s *ElapsedTime) String() string
String returns a string representing the elapsed time.
func (*ElapsedTime) Time ¶
func (s *ElapsedTime) Time() (time.Time, time.Time)
Time returns start time and end time.
func (*ElapsedTime) UnmarshalJSON ¶
func (s *ElapsedTime) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the json.Unmarshaler interface.
Click to show internal directories.
Click to hide internal directories.