Move NowMs() to EmberDefines

This prevents a circular reference where Isaac.h requires this method, but Utils.h includes Isaac.h
This commit is contained in:
Simon Detheridge 2015-04-13 12:12:38 +01:00
parent e8bbfdd2d4
commit 3f5db01a06
2 changed files with 8 additions and 7 deletions

View File

@ -77,6 +77,14 @@ namespace EmberNs
#define EMPTYFIELD -9999 #define EMPTYFIELD -9999
typedef std::chrono::high_resolution_clock Clock; typedef std::chrono::high_resolution_clock Clock;
/// <summary>
/// Thin wrapper around getting the current time in milliseconds.
/// </summary>
static inline size_t NowMs()
{
return duration_cast<milliseconds>(Clock::now().time_since_epoch()).count();
}
#ifndef byte #ifndef byte
typedef unsigned char byte; typedef unsigned char byte;
#endif #endif

View File

@ -44,13 +44,6 @@ static inline size_t SizeOf(vector<T>& vec)
return sizeof(vec[0]) * vec.size(); return sizeof(vec[0]) * vec.size();
} }
/// <summary>
/// Thin wrapper around getting the current time in milliseconds.
/// </summary>
static inline size_t NowMs()
{
return duration_cast<milliseconds>(Clock::now().time_since_epoch()).count();
}
/// <summary> /// <summary>
/// After a run completes, information about what was run can be saved as strings to the comments /// After a run completes, information about what was run can be saved as strings to the comments
/// section of a jpg or png file. This class is just a container for those values. /// section of a jpg or png file. This class is just a container for those values.