diff --git a/Snowflake.Data.Tests/IntegrationTests/ConnectionMultiplePoolsIT.cs b/Snowflake.Data.Tests/IntegrationTests/ConnectionMultiplePoolsIT.cs index 069db4d97..f25ed353b 100644 --- a/Snowflake.Data.Tests/IntegrationTests/ConnectionMultiplePoolsIT.cs +++ b/Snowflake.Data.Tests/IntegrationTests/ConnectionMultiplePoolsIT.cs @@ -1,8 +1,6 @@ using System; using System.Data; -using System.Diagnostics; using System.Linq; -using System.Threading; using System.Threading.Tasks; using NUnit.Framework; using Snowflake.Data.Client; @@ -113,7 +111,7 @@ public void TestWaitForTheIdleConnectionWhenExceedingMaxConnectionsLimit() pool.SetWaitingTimeout(1000); var conn1 = OpenedConnection(connectionString); var conn2 = OpenedConnection(connectionString); - var watch = new Stopwatch(); + var watch = new StopWatch(); // act watch.Start(); @@ -145,7 +143,7 @@ public void TestWaitForTheIdleConnectionWhenExceedingMaxConnectionsLimitAsync() pool.SetWaitingTimeout(1000); var conn1 = OpenedConnection(connectionString); var conn2 = OpenedConnection(connectionString); - var watch = new Stopwatch(); + var watch = new StopWatch(); // act watch.Start(); @@ -180,7 +178,7 @@ public void TestWaitInAQueueForAnIdleSession() .NewThread("B", 50, 2000, true) .NewThread("C", 100, 0, true) .NewThread("D", 150, 0, true); - var watch = new Stopwatch(); + var watch = new StopWatch(); // act watch.Start(); diff --git a/Snowflake.Data.Tests/Util/StopWatch.cs b/Snowflake.Data.Tests/Util/StopWatch.cs new file mode 100644 index 000000000..0ef200508 --- /dev/null +++ b/Snowflake.Data.Tests/Util/StopWatch.cs @@ -0,0 +1,25 @@ +using System; + +namespace Snowflake.Data.Tests.Util +{ + internal class StopWatch + { + private long _startMillis; + private long _stopMillis; + + public long ElapsedMilliseconds + { + get => _stopMillis - _startMillis; + } + + public void Start() + { + _startMillis = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); + } + + public void Stop() + { + _stopMillis = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(); + } + } +}