Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unity_internals: Update UNITY_PRINT_EXEC_TIME for older versions of clang #750

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/unity_internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -398,13 +398,13 @@ typedef UNITY_FLOAT_TYPE UNITY_FLOAT;
#define UNITY_GET_TIME(t) clock_gettime(CLOCK_MONOTONIC, &t)
#define UNITY_EXEC_TIME_START() UNITY_GET_TIME(Unity.CurrentTestStartTime)
#define UNITY_EXEC_TIME_STOP() UNITY_GET_TIME(Unity.CurrentTestStopTime)
#define UNITY_PRINT_EXEC_TIME() { \
UNITY_UINT execTimeMs = ((Unity.CurrentTestStopTime.tv_sec - Unity.CurrentTestStartTime.tv_sec) * 1000L); \
execTimeMs += ((Unity.CurrentTestStopTime.tv_nsec - Unity.CurrentTestStartTime.tv_nsec) / 1000000L); \
#define UNITY_PRINT_EXEC_TIME() do { \
UNITY_UINT execTimeMs = (UNITY_UINT)((Unity.CurrentTestStopTime.tv_sec - Unity.CurrentTestStartTime.tv_sec) * 1000L); \
execTimeMs += (UNITY_UINT)((Unity.CurrentTestStopTime.tv_nsec - Unity.CurrentTestStartTime.tv_nsec) / 1000000L); \
UnityPrint(" ("); \
UnityPrintNumberUnsigned(execTimeMs); \
UnityPrint(" ms)"); \
}
} while(0)
#endif
#endif
#endif
Expand Down