Index: System.Data.SQLite/SQLiteConnection.cs ================================================================== --- System.Data.SQLite/SQLiteConnection.cs +++ System.Data.SQLite/SQLiteConnection.cs @@ -3536,12 +3536,17 @@ TimeSpan elapsed = now.Subtract(start); // // NOTE: Are we done wait? // - if (elapsed.TotalMilliseconds >= (double)timeoutMilliseconds) + double totalMilliseconds = elapsed.TotalMilliseconds; + + if ((totalMilliseconds < 0) || /* Time went backward? */ + (totalMilliseconds >= (double)timeoutMilliseconds)) + { return false; + } // // NOTE: Sleep for a bit and then try again. // Thread.Sleep(sleepMilliseconds);