Skip to content

Commit 5c2fd23

Browse files
committed
support float seconds
1 parent dd72e75 commit 5c2fd23

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmd/root.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ var rootCmd = &cobra.Command{
3333
return nil
3434
}
3535

36-
if seconds, err := strconv.Atoi(args[0]); err == nil {
37-
duration = time.Duration(seconds) * time.Second
36+
if seconds, err := strconv.ParseFloat(args[0], 64); err == nil {
37+
duration = time.Duration(seconds * float64(time.Second))
3838
} else {
3939
duration, err = time.ParseDuration(args[0])
4040
if err != nil {

0 commit comments

Comments
 (0)