-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
46 lines (37 loc) · 736 Bytes
/
main.go
File metadata and controls
46 lines (37 loc) · 736 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package main
import (
"fmt"
"sync"
"time"
infofetchers "github.com/Pancaakeman/cakefetch/infoFetchers"
)
func main() {
startTime := time.Now()
chOsInfo := make(chan string, 2)
chTime := make(chan any, 2)
wg := sync.WaitGroup{}
infofetchers.OsInfo(chOsInfo, &wg)
infofetchers.OSStats(chTime, &wg)
infofetchers.OsNet(&wg)
wg.Wait()
defer close(chOsInfo)
defer close(chTime)
defer fmt.Println("Time taken to execute:", time.Since(startTime))
}
/*
func ChannelRead(chOsString chan string, chTime chan any, wg *sync.WaitGroup) {
wg.Add(2)
go func() {
defer wg.Done()
for i := range chOsString {
fmt.Println(i)
}
}()
go func() {
defer wg.Done()
for i := range chTime {
fmt.Println(i)
}
}()
}
*/