mirror of
https://github.com/genuinetools/reg.git
synced 2024-09-19 00:31:02 -04:00
13 lines
291 B
Go
13 lines
291 B
Go
|
package time
|
||
|
|
||
|
import (
|
||
|
"strconv"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
// DurationToSecondsString converts the specified duration to the number
|
||
|
// seconds it represents, formatted as a string.
|
||
|
func DurationToSecondsString(duration time.Duration) string {
|
||
|
return strconv.FormatFloat(duration.Seconds(), 'f', 0, 64)
|
||
|
}
|