Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9acc18e1fa | |||
| 7125bbc537 |
@@ -36,6 +36,25 @@ namespace GameDevLibrary.Helpers
|
||||
return stopwatch.ElapsedMilliseconds;
|
||||
}
|
||||
|
||||
public static long RecordAndSaveToResults(string key, Action actionToRecord)
|
||||
{
|
||||
var stopwatch = new Stopwatch();
|
||||
stopwatch.Start();
|
||||
|
||||
actionToRecord.Invoke();
|
||||
|
||||
stopwatch.Stop();
|
||||
|
||||
if (!_benchmarks.ContainsKey(key))
|
||||
{
|
||||
_benchmarks[key] = new List<long>();
|
||||
}
|
||||
|
||||
_benchmarks[key].Add(stopwatch.ElapsedMilliseconds);
|
||||
|
||||
return stopwatch.ElapsedMilliseconds;
|
||||
}
|
||||
|
||||
public static void Start(string key)
|
||||
{
|
||||
GetStopwatch(key).Restart();
|
||||
|
||||
@@ -84,6 +84,9 @@ namespace GameDevLibrary.Models
|
||||
|
||||
public IEnumerable<NeoDictionaryItem<TKey, TValue>> Select(Func<NeoDictionaryItem<TKey, TValue>, NeoDictionaryItem<TKey, TValue>> selector) =>
|
||||
Items.Select(selector);
|
||||
|
||||
public int IndexOf(NeoDictionaryItem<TKey, TValue> selector) =>
|
||||
Items.IndexOf(selector);
|
||||
|
||||
public void Remove(TKey key)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user