move IXBench code under ixwebsocker folder
This commit is contained in:
parent
61e789d6a4
commit
dffa759f71
@ -21,6 +21,7 @@ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
set( IXWEBSOCKET_SOURCES
|
set( IXWEBSOCKET_SOURCES
|
||||||
|
ixwebsocket/IXBench.cpp
|
||||||
ixwebsocket/IXCancellationRequest.cpp
|
ixwebsocket/IXCancellationRequest.cpp
|
||||||
ixwebsocket/IXConnectionState.cpp
|
ixwebsocket/IXConnectionState.cpp
|
||||||
ixwebsocket/IXDNSLookup.cpp
|
ixwebsocket/IXDNSLookup.cpp
|
||||||
@ -53,6 +54,7 @@ set( IXWEBSOCKET_SOURCES
|
|||||||
)
|
)
|
||||||
|
|
||||||
set( IXWEBSOCKET_HEADERS
|
set( IXWEBSOCKET_HEADERS
|
||||||
|
ixwebsocket/IXBench.h
|
||||||
ixwebsocket/IXCancellationRequest.h
|
ixwebsocket/IXCancellationRequest.h
|
||||||
ixwebsocket/IXConnectionState.h
|
ixwebsocket/IXConnectionState.h
|
||||||
ixwebsocket/IXDNSLookup.h
|
ixwebsocket/IXDNSLookup.h
|
||||||
|
@ -6,13 +6,13 @@
|
|||||||
|
|
||||||
#include "IXBench.h"
|
#include "IXBench.h"
|
||||||
|
|
||||||
#include <spdlog/spdlog.h>
|
#include <iostream>
|
||||||
|
|
||||||
namespace ix
|
namespace ix
|
||||||
{
|
{
|
||||||
Bench::Bench(const std::string& description)
|
Bench::Bench(const std::string& description)
|
||||||
: _description(description)
|
: _description(description)
|
||||||
, _start(std::chrono::system_clock::now())
|
, _start(std::chrono::high_resolution_clock::now())
|
||||||
, _reported(false)
|
, _reported(false)
|
||||||
{
|
{
|
||||||
;
|
;
|
||||||
@ -28,11 +28,11 @@ namespace ix
|
|||||||
|
|
||||||
void Bench::report()
|
void Bench::report()
|
||||||
{
|
{
|
||||||
auto now = std::chrono::system_clock::now();
|
auto now = std::chrono::high_resolution_clock::now();
|
||||||
auto milliseconds = std::chrono::duration_cast<std::chrono::milliseconds>(now - _start);
|
auto milliseconds = std::chrono::duration_cast<std::chrono::milliseconds>(now - _start);
|
||||||
|
|
||||||
_ms = milliseconds.count();
|
_ms = milliseconds.count();
|
||||||
spdlog::info("{} completed in {} ms", _description, _ms);
|
std::cerr << _description << " completed in " << _ms << "ms" << std::endl;
|
||||||
|
|
||||||
_reported = true;
|
_reported = true;
|
||||||
}
|
}
|
@ -21,7 +21,7 @@ namespace ix
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
std::string _description;
|
std::string _description;
|
||||||
std::chrono::time_point<std::chrono::system_clock> _start;
|
std::chrono::time_point<std::chrono::high_resolution_clock> _start;
|
||||||
uint64_t _ms;
|
uint64_t _ms;
|
||||||
bool _reported;
|
bool _reported;
|
||||||
};
|
};
|
@ -35,7 +35,6 @@ endif()
|
|||||||
add_executable(ws
|
add_executable(ws
|
||||||
../third_party/msgpack11/msgpack11.cpp
|
../third_party/msgpack11/msgpack11.cpp
|
||||||
${JSONCPP_SOURCES}
|
${JSONCPP_SOURCES}
|
||||||
IXBench.cpp
|
|
||||||
|
|
||||||
ws_http_client.cpp
|
ws_http_client.cpp
|
||||||
ws_ping_pong.cpp
|
ws_ping_pong.cpp
|
||||||
|
Loading…
Reference in New Issue
Block a user