Skip to content

Commit

Permalink
added file/folder transfer time
Browse files Browse the repository at this point in the history
  • Loading branch information
El-JojA committed Oct 25, 2017
1 parent 0e29a3f commit c173987
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions connect.go
Expand Up @@ -212,6 +212,7 @@ func (c *Connection) runClient() error {
"sender?": c.IsSender,
})

startTime:= time.Now()
c.HashedCode = Hash(c.Code)

var wg sync.WaitGroup
Expand Down Expand Up @@ -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.")
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit c173987

Please sign in to comment.