go.charczuk.com@v0.0.0-20240327042549-bc490516bd1a/sdk/simutil/event_interval_average.go (about) 1 /* 2 3 Copyright (c) 2023 - Present. Will Charczuk. All rights reserved. 4 Use of this source code is governed by a MIT license that can be found in the LICENSE file at the root of the repository. 5 6 */ 7 8 package simutil 9 10 import "time" 11 12 // EventIntervalAverage yields the average event interval given an even count and total 13 // event duration. 14 func EventIntervalAverage(eventCount uint64, simulationDuration time.Duration) time.Duration { 15 quo := simulationDuration / time.Duration(eventCount) 16 return time.Duration(quo) 17 }