File tree Expand file tree Collapse file tree 3 files changed +28
-1
lines changed
Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ private void UpdateLoop()
8383 UpdateAllObjectsList ( ) ;
8484 }
8585 m_updateThreadSync . WaitOne ( ) ;
86- Thread . Sleep ( UpdateInterval - stopwatch . Elapsed ) ;
86+ Thread . Sleep ( TimeSpanUtility . Max ( TimeSpan . Zero , UpdateInterval - stopwatch . Elapsed ) ) ;
8787 }
8888 }
8989
Original file line number Diff line number Diff line change 9696 <Compile Include =" Structure\Unity\UnitySprite.cs" />
9797 <Compile Include =" Structure\Unity\UnityFolder.cs" />
9898 <Compile Include =" Utility\ListViewExtender.cs" />
99+ <Compile Include =" Utility\TimeSpanUtility.cs" />
99100 <Compile Include =" Utility\UnityClassIds.cs" />
100101 <EmbeddedResource Include =" GotoForm.resx" >
101102 <DependentUpon >GotoForm.cs</DependentUpon >
Original file line number Diff line number Diff line change 1+ // Copyright(c) 2018 Brian MacIntosh
2+ // MIT License
3+
4+ using System ;
5+
6+ namespace UnityProjectBrowser
7+ {
8+ public static class TimeSpanUtility
9+ {
10+ /// <summary>
11+ /// Returns the greater of the two <see cref="TimeSpan"/>s.
12+ /// </summary>
13+ public static TimeSpan Max ( TimeSpan a , TimeSpan b )
14+ {
15+ return a > b ? a : b ;
16+ }
17+
18+ /// <summary>
19+ /// Returns the lesser of the two <see cref="TimeSpan"/>s.
20+ /// </summary>
21+ public static TimeSpan Min ( TimeSpan a , TimeSpan b )
22+ {
23+ return a > b ? b : a ;
24+ }
25+ }
26+ }
You can’t perform that action at this time.
0 commit comments