TimeValue returns the time value (nanoseconds since Unix epoch) of this constant.
()
| 461 | |
| 462 | // TimeValue returns the time value (nanoseconds since Unix epoch) of this constant. |
| 463 | func (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. |
| 471 | func (c Constant) DurationValue() (int64, error) { |
no outgoing calls