Skip to content

Commit 52f8a57

Browse files
committed
style(LoopTimeoutPolicy): ✨ Add aggressive inlining for performance
1 parent 7b7c77e commit 52f8a57

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/WhileLoopTimeout/Logic/LoopTimeoutPolicy.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using System.Runtime.CompilerServices;
2+
13
namespace WhileLoopTimeout.Logic;
24

35
/// <summary>
@@ -14,6 +16,7 @@ internal static class LoopTimeoutPolicy
1416
/// <param name="timeoutMs">Timeout threshold in milliseconds.</param>
1517
/// <param name="abortRequested">Whether an external abort has been requested.</param>
1618
/// <returns>True when the loop should abort.</returns>
19+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
1720
public static bool ShouldAbort(long previousTick, long currentTick, long elapsedMs, int timeoutMs, bool abortRequested)
1821
{
1922
return abortRequested || (currentTick == previousTick && elapsedMs > timeoutMs);

0 commit comments

Comments
 (0)