all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
|
|
@ -0,0 +1,27 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
"strconv"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
lg := log.New(os.Stdout, "", 0)
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(len(os.Args) - 1)
|
||||
for _, a := range os.Args[1:] {
|
||||
if i, err := strconv.ParseInt(a, 10, 64); err != nil {
|
||||
lg.Print(err)
|
||||
wg.Done()
|
||||
} else {
|
||||
time.AfterFunc(time.Duration(i*int64(time.Second)), func() {
|
||||
lg.Print(i)
|
||||
wg.Done()
|
||||
})
|
||||
}
|
||||
}
|
||||
wg.Wait()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue