added hotreload

This commit is contained in:
2025-07-17 19:17:27 +02:00
parent faf4bd1ca9
commit 12e3b85770
380 changed files with 39434 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
using System;
namespace SingularityGroup.HotReload.Editor {
static class ExponentialBackoff {
public static TimeSpan GetTimeout(int attempt, int minBackoff = 250, int maxBackoff = 60000, int deltaBackoff = 400) {
attempt = Math.Min(25, attempt); // safety to avoid overflow below
var delta = (uint)(
(Math.Pow(2.0, attempt) - 1.0)
* deltaBackoff
);
var interval = Math.Min(checked(minBackoff + delta), maxBackoff);
return TimeSpan.FromMilliseconds(interval);
}
}
}