$(function () {
var now = new Date(), final = ew Date(2018, 1, 11);
if(now < final) {
$("#dateStart").countdown({until: new Date(2018, 2-1, 11), onExpiry: liftOff});
}
else {
liftOff()
}
function liftOff() {
alert('Завершено!');
}
});
package main
import (
"runtime"
"time"
"sync"
"fmt"
)
func main() {
runtime.GOMAXPROCS(1)
start := time.Now()
ch := make(chan bool, 10)
wg := sync.WaitGroup{}
for n := 0; n < 10; n++ {
go func(ch <- chan bool, wg *sync.WaitGroup) {
wg.Add(1)
for _ = range ch {
}
wg.Done()
}(ch, &wg)
}
for i := 0; i < 1e8; i++ {
ch <- true
}
close(ch)
wg.Wait()
fmt.Println(time.Since(start))
}