diff options
Diffstat (limited to 'tests/src/GC/Performance/Tests/GCSmall.cs')
-rw-r--r-- | tests/src/GC/Performance/Tests/GCSmall.cs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/src/GC/Performance/Tests/GCSmall.cs b/tests/src/GC/Performance/Tests/GCSmall.cs index e9c452bb35..5ce028f15d 100644 --- a/tests/src/GC/Performance/Tests/GCSmall.cs +++ b/tests/src/GC/Performance/Tests/GCSmall.cs @@ -3,6 +3,8 @@ // See the LICENSE file in the project root for more information. using System; +using System.Diagnostics; + internal class GCSmall { @@ -11,9 +13,12 @@ internal class GCSmall public static void Main(string[] p_args) { - long iterations = 200; + long iterations = 200000000; GCSmall ns = new GCSmall(); + Stopwatch sw = new Stopwatch(); + sw.Start(); + for (long i = 0; i < iterations; i++) { ns = new GCSmall(); @@ -32,5 +37,8 @@ internal class GCSmall Console.WriteLine("Shouldn't get here"); GC.KeepAlive(ns); + + sw.Stop(); + Console.WriteLine("took {0} ms in total", sw.ElapsedMilliseconds); } } |