Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print out speed of transfer #47

Closed
schollz opened this issue Oct 24, 2017 · 0 comments
Closed

Print out speed of transfer #47

schollz opened this issue Oct 24, 2017 · 0 comments

Comments

@schollz
Copy link
Owner

schollz commented Oct 24, 2017

After sending or receiving file, print out the rate of transfer in MB/s.

Basically, first there needs to be a timer here (e.g. start:= time.Now()) : https://github.com/schollz/croc/blob/master/connect.go#L214

For receiving the file, you should print out the speed here: https://github.com/schollz/croc/blob/master/connect.go#L468

For sending the file, you should print out the speed here: https://github.com/schollz/croc/blob/master/connect.go#L409

In both cases, the speed is the file size (c.File.Size) divided by the duration (e.g. time.Since(start)), preferably in MB/s.

Please feel free to ask me any questions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant