Changes to be committed: modified: main.go Add call to timer new file: timer/timer.go New 10 second timertimer
parent
0ea14fd132
commit
a46c855960
2 changed files with 24 additions and 0 deletions
@ -0,0 +1,21 @@ |
|||||||
|
package timer |
||||||
|
|
||||||
|
import ( |
||||||
|
"fmt" |
||||||
|
"time" |
||||||
|
//"reflect"
|
||||||
|
) |
||||||
|
|
||||||
|
func New() { |
||||||
|
|
||||||
|
timer_10s := time.NewTimer(10 * time.Second) |
||||||
|
// timer_1m := time.NewTimer(1 * time.Minute)
|
||||||
|
fmt.Println("Waiting 10 seconds...") |
||||||
|
<-timer_10s.C |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// for elapsed < ten_seconds {
|
||||||
|
//}
|
||||||
|
// for
|
||||||
|
} |
Loading…
Reference in new issue