Created
February 24, 2015 13:43
-
-
Save alex-groshev/f1dc24fde2c7aa9f1ff3 to your computer and use it in GitHub Desktop.
How to use the LowLatency mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void LowLatencyDemo() | |
{ | |
GCLatencyMode oldMode = GCSettings.LatencyMode; | |
System.Runtime.CompilerServices.RuntimeHelpers.PrepareConstrainedRegions(); | |
try | |
{ | |
GCSettings.LatencyMode = GCLatencyMode.LowLatency; | |
// Run your code here... | |
} | |
finally | |
{ | |
GCSettings.LatencyMode = oldMode; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment