GoLang
xxxxxxxxxx
package main
import (
"fmt"
"time"
)
func main() {
c1 := make(chan string)
c2 := make(chan string)
go func() {
time.Sleep(1 * time.Second)
c1 <- "one"
}()
go func() {
time.Sleep(2 * time.Second)
c2 <- "two"
}()
for i := 0; i < 2; i++ {
select {
case msg1 := <-c1:
fmt.Println("received", msg1)
case msg2 := <-c2:
fmt.Println("received", msg2)
}
}
}
received one received two real 0m2.245s
Linux - كيفية تثبيت anc-api-tools
Linux - كيفية تثبيت curvedns
Python - تحقق مما إذا كان الرقم موجبًا أم سالبًا أم 0
Linux - كيفية تثبيت zenmap
C - عد عدد الأرقام في عدد صحيح
JavaScript - تحقق مما إذا كانت السلسلة تبدأ وتنتهي بأحرف معينة
C++ - تحقق من السنة الكبيسة
C++ - تحقق مما إذا كان الرقم أوليًا أم لا
C - ابحث عن أكبر رقم باستخدام تخصيص الذاكرة الديناميكي
Kotlin - تقريب رقم إلى n منازل عشرية
Kotlin - عكس رقم
Linux - كيفية تثبيت xbitmaps
Linux - كيفية تثبيت zstd
Kotlin - أوجد عاملي العدد
Linux - كيفية تثبيت zfs-test
Java - عكس رقم
Kotlin - احسب مجموع الأعداد الطبيعية
Kotlin - عد عدد الأرقام في عدد صحيح
We have been online since 2021 and 1 millions of people around the globe have visited our website since then
More visitors every month