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
1 changed files with 4 additions and 3 deletions

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
}