Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Closed
Show file tree
Hide file tree
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
14 changes: 6 additions & 8 deletions 14 CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,15 @@ cmake_minimum_required (VERSION 2.6)
enable_testing()

project (CppReact)
find_package(TBB REQUIRED tbb)

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set (CMAKE_CXX_STANDARD 14)
if (NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall -Wpedantic")
endif ()

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall -Wpedantic")

include_directories (SYSTEM "${PROJECT_SOURCE_DIR}/include")
#TODO send diff
include_directories("${TBB_DIR}/../include")

### CppReact
file(GLOB_RECURSE CPPREACT_HEADERS include/*.h)

Expand All @@ -26,7 +23,8 @@ add_library(CppReact
src/logging/EventRecords.cpp
${CPPREACT_HEADERS})

target_link_libraries(CppReact "${TBB_DIR}/../lib/intel64/vc14/tbb_debug.lib")
target_link_libraries(CppReact tbb)

### examples/
option(build_examples "Build examples?" ON)
if(build_examples)
Expand Down
26 changes: 25 additions & 1 deletion 26 include/react/common/Timing.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,39 @@

#include <utility>

#include <chrono>
#if _WIN32 || _WIN64
#define REACT_FIXME_CUSTOM_TIMER 1
#else
#define REACT_FIXME_CUSTOM_TIMER 0
#endif

#if REACT_FIXME_CUSTOM_TIMER
#include <windows.h>
#else
#include <chrono>
#endif

/***************************************/ REACT_IMPL_BEGIN /**************************************/

///////////////////////////////////////////////////////////////////////////////////////////////////
/// GetPerformanceFrequency
///////////////////////////////////////////////////////////////////////////////////////////////////
// Todo: Initialization not thread-safe
#if REACT_FIXME_CUSTOM_TIMER
inline const LARGE_INTEGER& GetPerformanceFrequency()
{
static bool init = false;
static LARGE_INTEGER frequency;

if (init == false)
{
QueryPerformanceFrequency(&frequency);
init = true;
}

return frequency;
}
#endif

///////////////////////////////////////////////////////////////////////////////////////////////////
/// ConditionalTimer
Expand Down
6 changes: 3 additions & 3 deletions 6 src/logging/EventLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ using std::chrono::microseconds;
/// EventLog
///////////////////////////////////////////////////////////////////////////////////////////////////
EventLog::Entry::Entry() :
time_{ std::chrono::steady_clock::now() },
time_{ std::chrono::system_clock::now() },
data_{ nullptr }
{
}
Expand All @@ -27,7 +27,7 @@ EventLog::Entry::Entry(const Entry& other) :
}

EventLog::Entry::Entry(IEventRecord* ptr) :
time_{ std::chrono::steady_clock::now() },
time_{ std::chrono::system_clock::now() },
data_{ ptr }
{
}
Expand All @@ -54,7 +54,7 @@ bool EventLog::Entry::Equals(const Entry& other) const
}

EventLog::EventLog() :
startTime_(std::chrono::steady_clock::now())
startTime_(std::chrono::system_clock::now())
{
}

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.