diff options
| author | Will Hawkins <[email protected]> | 2022-03-16 21:38:33 -0400 |
|---|---|---|
| committer | Will Hawkins <[email protected]> | 2022-03-16 21:38:33 -0400 |
| commit | aac7ecca40b9c5e4ffeedcd38f3c6bb24bd6c3e8 (patch) | |
| tree | 3ed7a1fac93958014f661937df3777434ed373a1 /utilities/utilities.go | |
| parent | b9616e661a27dde6b9eb62856226b1accd31908a (diff) | |
Refactor: Move magic numbers in to a constants module.
Diffstat (limited to 'utilities/utilities.go')
| -rw-r--r-- | utilities/utilities.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/utilities/utilities.go b/utilities/utilities.go index f2ab80d..337aa5e 100644 --- a/utilities/utilities.go +++ b/utilities/utilities.go @@ -42,6 +42,14 @@ func Conditional(condition bool, t string, f string) string { return f } +func ToMbps(bytes float64) float64 { + return ToMBps(bytes) * float64(8) +} + +func ToMBps(bytes float64) float64 { + return float64(bytes) / float64(1024*1024) +} + type GetLatency struct { Delay time.Duration RTTs uint16 |
