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()
83
83
UpdateAllObjectsList ( ) ;
84
84
}
85
85
m_updateThreadSync . WaitOne ( ) ;
86
- Thread . Sleep ( UpdateInterval - stopwatch . Elapsed ) ;
86
+ Thread . Sleep ( TimeSpanUtility . Max ( TimeSpan . Zero , UpdateInterval - stopwatch . Elapsed ) ) ;
87
87
}
88
88
}
89
89
Original file line number Diff line number Diff line change 96
96
<Compile Include =" Structure\Unity\UnitySprite.cs" />
97
97
<Compile Include =" Structure\Unity\UnityFolder.cs" />
98
98
<Compile Include =" Utility\ListViewExtender.cs" />
99
+ <Compile Include =" Utility\TimeSpanUtility.cs" />
99
100
<Compile Include =" Utility\UnityClassIds.cs" />
100
101
<EmbeddedResource Include =" GotoForm.resx" >
101
102
<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