File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,15 +3,18 @@ cmake_minimum_required (VERSION 2.6)
33enable_testing ()
44
55project (CppReact)
6-
6+ find_package ( TBB REQUIRED tbb )
77set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR } /lib)
88set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR } /lib)
99set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR } /bin)
10-
11- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS } -std=c++14 -Wall -Wpedantic" )
10+ set (CMAKE_CXX_STANDARD 14)
11+ if (NOT WIN32 )
12+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS } -std=c++14 -Wall -Wpedantic" )
13+ endif ()
1214
1315include_directories (SYSTEM "${PROJECT_SOURCE_DIR } /include" )
14-
16+ #TODO send diff
17+ include_directories ("${TBB_DIR} /../include" )
1518### CppReact
1619file (GLOB_RECURSE CPPREACT_HEADERS include /*.h )
1720
@@ -23,8 +26,7 @@ add_library(CppReact
2326 src/logging/EventRecords.cpp
2427 ${CPPREACT_HEADERS} )
2528
26- target_link_libraries (CppReact tbb )
27-
29+ target_link_libraries (CppReact "${TBB_DIR} /../lib/intel64/vc14/tbb_debug.lib" )
2830### examples/
2931option (build_examples "Build examples?" ON )
3032if (build_examples)
Original file line number Diff line number Diff line change 1313
1414#include < utility>
1515
16- #if _WIN32 || _WIN64
17- #define REACT_FIXME_CUSTOM_TIMER 1
18- #else
19- #define REACT_FIXME_CUSTOM_TIMER 0
20- #endif
16+ #include < chrono>
2117
22- #if REACT_FIXME_CUSTOM_TIMER
23- #include < windows.h>
24- #else
25- #include < chrono>
26- #endif
2718
2819/* **************************************/ REACT_IMPL_BEGIN /* *************************************/
2920
3021// /////////////////////////////////////////////////////////////////////////////////////////////////
3122// / GetPerformanceFrequency
3223// /////////////////////////////////////////////////////////////////////////////////////////////////
3324// Todo: Initialization not thread-safe
34- #if REACT_FIXME_CUSTOM_TIMER
35- inline const LARGE_INTEGER & GetPerformanceFrequency ()
36- {
37- static bool init = false ;
38- static LARGE_INTEGER frequency;
39-
40- if (init == false )
41- {
42- QueryPerformanceFrequency (&frequency);
43- init = true ;
44- }
45-
46- return frequency;
47- }
48- #endif
4925
5026// /////////////////////////////////////////////////////////////////////////////////////////////////
5127// / ConditionalTimer
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ using std::chrono::microseconds;
1515// / EventLog
1616// /////////////////////////////////////////////////////////////////////////////////////////////////
1717EventLog::Entry::Entry () :
18- time_{ std::chrono::system_clock ::now () },
18+ time_{ std::chrono::steady_clock ::now () },
1919 data_{ nullptr }
2020{
2121}
@@ -27,7 +27,7 @@ EventLog::Entry::Entry(const Entry& other) :
2727}
2828
2929EventLog::Entry::Entry (IEventRecord* ptr) :
30- time_{ std::chrono::system_clock ::now () },
30+ time_{ std::chrono::steady_clock ::now () },
3131 data_{ ptr }
3232{
3333}
@@ -54,7 +54,7 @@ bool EventLog::Entry::Equals(const Entry& other) const
5454}
5555
5656EventLog::EventLog () :
57- startTime_(std::chrono::system_clock ::now())
57+ startTime_(std::chrono::steady_clock ::now())
5858{
5959}
6060
You can’t perform that action at this time.
0 commit comments