Skip to content

Commit

Permalink
fix: reduce the event record times for github action
Browse files Browse the repository at this point in the history
  • Loading branch information
zhu-xiaowei committed Jul 11, 2024
1 parent e84416d commit 664f064
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Tests/Runtime/ClickstreamPerformanceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ public void TestPerformanceWhenUseMemoryCache()
});
var stopwatch = new Stopwatch();
stopwatch.Start();
for (var i = 0; i < 100; i++)
for (var i = 0; i < 20; i++)
{
ClickstreamAnalytics.Record("testEvent", ClickstreamTests.GetProperties());
}

stopwatch.Stop();
var elapsedMilliseconds = (stopwatch.ElapsedTicks / (double)Stopwatch.Frequency) * 1000;
UnityEngine.Debug.Log("Save 100 events cost: " + elapsedMilliseconds + " ms");
UnityEngine.Debug.Log("Save 20 events cost: " + elapsedMilliseconds + " ms");
Assert.True(elapsedMilliseconds < 16);
}

Expand All @@ -53,14 +53,14 @@ public void TestPerformanceWhenUsePlayerPrefs()
});
var stopwatch = new Stopwatch();
stopwatch.Start();
for (var i = 0; i < 10; i++)
for (var i = 0; i < 5; i++)
{
ClickstreamAnalytics.Record("testEvent", ClickstreamTests.GetProperties());
ClickstreamAnalytics.Record("testEvent");
}

stopwatch.Stop();
var elapsedMilliseconds = stopwatch.ElapsedTicks / (double)Stopwatch.Frequency * 1000;
UnityEngine.Debug.Log("Save 10 events cost: " + elapsedMilliseconds + " ms");
UnityEngine.Debug.Log("Save 5 events cost: " + elapsedMilliseconds + " ms");
Assert.True(elapsedMilliseconds < 16);
}
}
Expand Down

0 comments on commit 664f064

Please sign in to comment.