Исходники и презентации

This commit is contained in:
2025-05-23 07:26:39 +03:00
parent aa948179d5
commit 02d8430a3a
514 changed files with 13773 additions and 0 deletions

View File

@ -0,0 +1,38 @@
package main
import (
"fmt"
"time"
)
// Need to show solution
func FetchData1() chan int {
ch := make(chan int)
go func() {
time.Sleep(time.Second * 2)
ch <- 10
}()
return ch
}
func FetchData2() chan int {
ch := make(chan int)
go func() {
time.Sleep(time.Second * 2)
ch <- 20
}()
return ch
}
func Process(value1, value2 int) {
// Processing...
}
func main() {
start := time.Now()
Process(<-FetchData1(), <-FetchData2())
fmt.Println(time.Now().Sub(start))
}