Skip to content

Commit

Permalink
As it turns out, Milliseconds != TotalMilliseconds
Browse files Browse the repository at this point in the history
  • Loading branch information
rampaa committed Mar 20, 2022
1 parent 39196c3 commit 4915878
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion JL.Core/Lookup/Lookup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static class Lookup
public static List<Dictionary<LookupResult, List<string>>> LookupText(string text)
{
DateTime preciseTimeNow = new(Stopwatch.GetTimestamp());
if ((preciseTimeNow - s_lastLookupTime).Milliseconds < Storage.Frontend.CoreConfig.LookupRate) return null;
if ((preciseTimeNow - s_lastLookupTime).TotalMilliseconds < Storage.Frontend.CoreConfig.LookupRate) return null;
s_lastLookupTime = preciseTimeNow;

if (Storage.Frontend.CoreConfig.KanjiMode)
Expand Down
2 changes: 1 addition & 1 deletion JL.Core/Storage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static class Storage

// public static readonly string ResourcesPath = Path.Join(Directory.GetCurrentDirectory(), "Resources");
public static readonly HttpClient Client = new(new HttpClientHandler { UseProxy = false });
public static readonly Version Version = new(1, 6);
public static readonly Version Version = new(1, 7);
public static readonly string RepoUrl = "https://github.com/rampaa/JL/";
public static bool Ready { get; set; } = false;
public static bool UpdatingJMdict { get; set; } = false;
Expand Down
3 changes: 2 additions & 1 deletion JL.Windows/GUI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ private void CopyFromClipboard()
private void ClipboardChanged(object sender, EventArgs e)
{
DateTime currentTime = new(Stopwatch.GetTimestamp());
if ((currentTime - _lastClipboardChangeTime).Milliseconds > 5)

if ((currentTime - _lastClipboardChangeTime).TotalMilliseconds > 5)
{
_lastClipboardChangeTime = currentTime;
CopyFromClipboard();
Expand Down

0 comments on commit 4915878

Please sign in to comment.