From 89f26501e59095e1e6ac59cf158f6305e4e93389 Mon Sep 17 00:00:00 2001 From: Will Hawkins Date: Fri, 13 May 2022 11:02:09 -0400 Subject: [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). --- utilities/utilities.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'utilities/utilities.go') 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 +} -- cgit v1.2.3