MCPcopy
hub / github.com/google/mangle / TimeValue

Method TimeValue

ast/ast.go:463–468  ·  view source on GitHub ↗

TimeValue returns the time value (nanoseconds since Unix epoch) of this constant.

()

Source from the content-addressed store, hash-verified

461
462// TimeValue returns the time value (nanoseconds since Unix epoch) of this constant.
463func (c Constant) TimeValue() (int64, error) {
464 if c.Type != TimeType {
465 return 0, fmt.Errorf("not a time constant %v", c)
466 }
467 return c.NumValue, nil
468}
469
470// DurationValue returns the duration value (nanoseconds) of this constant.
471func (c Constant) DurationValue() (int64, error) {

Callers 8

resolveBoundWithSubstFunction · 0.80
TestTimeConstantFunction · 0.80
TestTimeValueErrorFunction · 0.80
getTimeValueFunction · 0.80
TestTimeNowFunction · 0.80
EvalApplyFnFunction · 0.80
TestIntervalStartFunction · 0.80
TestIntervalEndFunction · 0.80

Calls

no outgoing calls

Tested by 5

TestTimeConstantFunction · 0.64
TestTimeValueErrorFunction · 0.64
TestTimeNowFunction · 0.64
TestIntervalStartFunction · 0.64
TestIntervalEndFunction · 0.64