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

fix types mismatched with transfer duration

This commit is contained in:
Mr. Joja 2017-10-25 00:28:41 -06:00
parent dd6cf4ba76
commit 414507ab1c

View File

@ -408,7 +408,8 @@ 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))))
timeSinceStart:= time.Since(startTime) / time.Second
fmt.Printf("\nTransfered with an average speed of %s/s", humanize.Bytes(uint64(float64(c.File.Size)/float64(timeSinceStart))))
} else { // Is a Receiver
if responses.notPresent {
fmt.Println("Sender is not ready. Use -wait to wait until sender connects.")
@ -467,8 +468,8 @@ func (c *Connection) runClient() error {
} else {
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))))
timeSinceStart:= time.Since(startTime) / time.Second
fmt.Printf("\nTransfered with an average speed of %s/s", humanize.Bytes(uint64(float64(c.File.Size)/float64(timeSinceStart))))
}
return nil
}