GoToolSharing / htb-cli

Interact with Hackthebox using your terminal - Be faster and more competitive !
https://github.com/GoToolSharing/htb-cli
GNU General Public License v3.0
86 stars 6 forks source link

Goroutines #67

Closed QU35T-code closed 9 months ago

QU35T-code commented 10 months ago

Add goroutines to optimize api call time

QU35T-code commented 9 months ago

Without goroutines (13 seconds) :

> time go run . vpn --download
VPN : EU_VIP_7 downloaded successfully
VPN : EU_StartingPoint_VIP_1 downloaded successfully
VPN : EU_Endgame_VIP_1 downloaded successfully
VPN : EU_Fortress_1 downloaded successfully
VPN : EU_Release_Arena_1 downloaded successfully

VPNs are located at the following path : /home/qu35t/.local/htb-cli

go run . vpn --download  0,332 user 0,058 system 2% cpu (13,055 wasted time).

With goroutines (3 secondes) :

> time go run . vpn --download
VPN : EU_Fortress_1 downloaded successfully
VPN : EU_StartingPoint_VIP_1 downloaded successfully
VPN : EU_Release_Arena_1 downloaded successfully
VPN : EU_Endgame_VIP_1 downloaded successfully
VPN : EU_VIP_7 downloaded successfully

VPNs are located at the following path : /home/qu35t/.local/htb-cli
go run . vpn --download  0,606 user 0,075 system 22% cpu (3,078 wasted time).