-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #728 from bugsnag/removeDateTimeNowUsage
Backport Release v6.3.4
- Loading branch information
Showing
8 changed files
with
80 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System; | ||
using System.Diagnostics; | ||
|
||
namespace BugsnagUnity | ||
{ | ||
// A simple timer used internally to avoid thread complications when using the unity Time API | ||
internal class Time | ||
{ | ||
|
||
private static object _swLock = new object(); | ||
|
||
private static Stopwatch _sw; | ||
|
||
internal static Stopwatch Timer | ||
{ | ||
get | ||
{ | ||
if (_sw == null) | ||
{ | ||
lock (_swLock) | ||
{ | ||
if (_sw == null) | ||
{ | ||
_sw = Stopwatch.StartNew(); | ||
} | ||
} | ||
} | ||
return _sw; | ||
} | ||
} | ||
|
||
internal static double ElapsedSeconds => Timer.Elapsed.TotalSeconds; | ||
|
||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
using System; | ||
namespace UnityEngine | ||
namespace UnityEngine | ||
{ | ||
public class Time | ||
{ | ||
|
||
public static float realtimeSinceStartup { get; set; } | ||
|
||
} | ||
} | ||
} |