1
0
mirror of https://github.com/schollz/croc.git synced 2024-11-24 08:02:33 +03:00

Merge pull request #49 from El-JojA/master

Added file/folder transfer time
This commit is contained in:
Zack 2017-10-25 05:43:12 -06:00 committed by GitHub
commit ab434a8955

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
@ -465,8 +466,9 @@ func (c *Connection) runClient() error {
} else {
fmt.Printf("\nReceived file written to %s\n", path.Join(c.Path, c.File.Name))
}
}
timeSinceStart:= time.Since(startTime) / time.Second
fmt.Printf("\nTransfered at an average speed of %s/s", humanize.Bytes(uint64(float64(c.File.Size)/float64(timeSinceStart))))
return nil
}