@@ -14,17 +14,34 @@ public static class TimeUtility
1414 /// Start new timer, with given name.
1515 /// You can check timer second value via <see cref="GetTime"/> method.
1616 /// </summary>
17- /// <param name="name">Timer name.</param>
17+ /// <param name="name">The name of the timer .</param>
1818 public static void StartTimer ( string name )
1919 {
2020 s_Timers [ name ] = DateTime . Now . Ticks ;
2121 }
2222
23+ /// <summary>
24+ /// Removes timer from timers list.
25+ /// </summary>
26+ /// <param name="name">The name of the timer.</param>
27+ public static void RemoveTimer ( string name ) {
28+ s_Timers . Remove ( name ) ;
29+ }
30+
31+ /// <summary>
32+ /// Method allows if time with specified name exists.
33+ /// </summary>
34+ /// <param name="name">The name of the timer.</param>
35+ /// <returns>`true` if timer exists and `false` otherwise.</returns>
36+ public static bool HasTimer ( string name ) {
37+ return s_Timers . ContainsKey ( name ) ;
38+ }
39+
2340 /// <summary>
2441 /// Get timer value in seconds by timer name. You may star any number of timers using the <see cref="StartTimer"/> method.
2542 /// If timer with specified name doesn't exist `0` value will be returned.
2643 /// </summary>
27- /// <param name="name">Timer name.</param>
44+ /// <param name="name">The name of the timer .</param>
2845 /// <returns>Timer value in seconds</returns>
2946 public static float GetTime ( string name )
3047 {
@@ -37,7 +54,6 @@ public static float GetTime(string name)
3754 return 0f ;
3855 }
3956
40-
4157 /// <summary>
4258 /// Converts a UNIX time stamp into <see cref="DateTime"/> object.
4359 /// </summary>
0 commit comments