mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 21:30:16 +02:00
added file/folder transfer time
This commit is contained in:
parent
0e29a3f658
commit
c173987d7b
1 changed files with 3 additions and 0 deletions
|
@ -212,6 +212,7 @@ func (c *Connection) runClient() error {
|
||||||
"sender?": c.IsSender,
|
"sender?": c.IsSender,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
startTime:= time.Now()
|
||||||
c.HashedCode = Hash(c.Code)
|
c.HashedCode = Hash(c.Code)
|
||||||
|
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
|
@ -407,6 +408,7 @@ func (c *Connection) runClient() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
fmt.Println("\nFile sent.")
|
fmt.Println("\nFile sent.")
|
||||||
|
fmt.Printf("\nTransfered with an average speed of %s/s", humanize.Bytes(uint64(c.File.Size/time.since(startTime))))
|
||||||
} else { // Is a Receiver
|
} else { // Is a Receiver
|
||||||
if responses.notPresent {
|
if responses.notPresent {
|
||||||
fmt.Println("Sender is not ready. Use -wait to wait until sender connects.")
|
fmt.Println("Sender is not ready. Use -wait to wait until sender connects.")
|
||||||
|
@ -466,6 +468,7 @@ func (c *Connection) runClient() error {
|
||||||
fmt.Printf("\nReceived file written to %s\n", path.Join(c.Path, c.File.Name))
|
fmt.Printf("\nReceived file written to %s\n", path.Join(c.Path, c.File.Name))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fmt.Printf("\nTransfered with an average speed of %s/s", humanize.Bytes(uint64(c.File.Size/time.since(startTime))))
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue