diff options
| author | Will Hawkins <[email protected]> | 2022-05-13 11:02:09 -0400 |
|---|---|---|
| committer | Will Hawkins <[email protected]> | 2022-05-13 11:02:09 -0400 |
| commit | 89f26501e59095e1e6ac59cf158f6305e4e93389 (patch) | |
| tree | 3a34ea2fd09c0dc343d10c629c877d6b9fe8fdc7 /utilities/utilities.go | |
| parent | f0dcb55643612ab05137314b46ee66ccf9308a53 (diff) | |
[Refactor] Create config package and package-ify saturate()
1. Create a separate package to handle the config information.
2. Move the saturate functionality into the rpm package.
3. Do general renaming/refactoring so that we are consistently
saying measurement and not RTT (this nomenclature is more consistent
with the standard).
Diffstat (limited to 'utilities/utilities.go')
| -rw-r--r-- | utilities/utilities.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/utilities/utilities.go b/utilities/utilities.go index 4b114ba..a143d31 100644 --- a/utilities/utilities.go +++ b/utilities/utilities.go @@ -17,6 +17,7 @@ package utilities import ( "fmt" "math" + "math/rand" "os" "reflect" "sync/atomic" @@ -117,3 +118,7 @@ func (optional Optional[S]) String() string { return "None" } } + +func RandBetween(max int) int { + return rand.New(rand.NewSource(int64(time.Now().Nanosecond()))).Int() % max +} |
