use $MAIN_INTERVAL_DURATION

master
Bel LaPointe 2023-03-02 09:52:15 -07:00
parent 5edefdff5f
commit 594bc39470
2 changed files with 13 additions and 1 deletions

View File

@ -5,13 +5,21 @@ import (
"mayhem-party/src/device/input"
"mayhem-party/src/device/output"
"mayhem-party/src/device/output/key"
"os"
"time"
)
func Main(ctx context.Context) error {
reader := input.New()
writer := output.New()
c := time.NewTicker(time.Millisecond * 50)
interval := time.Millisecond * 50
if intervalS, ok := os.LookupEnv("MAIN_INTERVAL_DURATION"); !ok {
} else if v, err := time.ParseDuration(intervalS); err != nil {
panic(err)
} else {
interval = v
}
c := time.NewTicker(interval)
defer c.Stop()
block := func() bool {

View File

@ -0,0 +1,4 @@
w: 20
a: 10
s: 5
d: 40