On branch timer

Changes to be committed:
	modified:   main.go
		Add call to timer
	new file:   timer/timer.go
		New 10 second timer
timer
Mike Holloway 4 years ago
parent 0ea14fd132
commit a46c855960
  1. 3
      main.go
  2. 21
      timer/timer.go

@ -1,5 +1,7 @@
package main package main
import ( import (
"./timer"
"fmt" "fmt"
"strings" "strings"
"regexp" "regexp"
@ -16,6 +18,7 @@ func main() {
// and then converted byte by byte (2 char at a time) // and then converted byte by byte (2 char at a time)
//fmt.Println(convert_address(reverse_string(reverse_bytes("0100007F")))) //fmt.Println(convert_address(reverse_string(reverse_bytes("0100007F"))))
timer.New()
tcp_rows(read_tcp_file("/proc/net/tcp")) tcp_rows(read_tcp_file("/proc/net/tcp"))
} }

@ -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…
Cancel
Save