Skip to content

Commit

Permalink
feat: randomize time according to factor
Browse files Browse the repository at this point in the history
  • Loading branch information
CumpsD committed Aug 28, 2024
1 parent 78671f4 commit 999c7a8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions chainflip-insights/Infrastructure/RandomizeTimeExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ namespace ChainflipInsights.Infrastructure

public static class RandomizeTimeExtension
{
public static int RandomizeTime(this int originalTimeInMs)
=> originalTimeInMs + Random.Shared.Next(-5000, 5000);
public static int RandomizeTime(this int originalTimeInMs)
{
var factor = originalTimeInMs / 30000;
var random = factor * Random.Shared.Next(-5000, 5000);
return originalTimeInMs + (random < 0 ? 0 : random);
}
}
}

0 comments on commit 999c7a8

Please sign in to comment.