Files
sbox-public/engine/Sandbox.Test.Unit/data/StopwatchPanel.razor
Lorenz Junglas 91f8fcf183 Speed up / parallelize tests (#3587)
- Added Sandbox.Test.Unit project (contains independent tests that can run in parallel) 
- Modify some slow/stress tests (e.g. instead of doing a million iterations settle for 10k).

Tests run almost twice as fast now.
2025-12-10 14:23:00 +01:00

30 lines
632 B
Plaintext

@namespace TestComponents
@using System.Diagnostics;
@for ( int i=0; i<10; i++)
{
<div style="hello">
@for ( int j=0; j< 10; j++)
{
@i <div style="hello" @onclick=@Stop>poop</div>
}</div>
}
<div class="bigtext" @onclick=@Stop>
<div class="title @(Seconds < 5 ? "is-fucked" : "is-relax")">The time is @Formatted</div>
<div class="icon"><i>time</i></div>
</div>
@code
{
public string Formatted => sw.Elapsed.ToString();
public float Seconds => (float)sw.Elapsed.TotalSeconds;
Stopwatch sw = Stopwatch.StartNew();
public void Stop()
{
sw.Stop();
}
}