1
1
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 05:11:06 +02:00

added file/folder transfer time

This commit is contained in:
Mr. Joja 2017-10-24 22:40:48 -06:00
parent 0e29a3f658
commit c173987d7b

View file

@ -212,6 +212,7 @@ func (c *Connection) runClient() error {
"sender?": c.IsSender,
})
startTime:= time.Now()
c.HashedCode = Hash(c.Code)
var wg sync.WaitGroup
@ -407,6 +408,7 @@ func (c *Connection) runClient() error {
return nil
}
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
if responses.notPresent {
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("\nTransfered with an average speed of %s/s", humanize.Bytes(uint64(c.File.Size/time.since(startTime))))
}
return nil
}