Commit 03f0e219 authored by gabime's avatar gabime

Fix async bench under msvc

parent a33de607
...@@ -26,6 +26,11 @@ using namespace utils; ...@@ -26,6 +26,11 @@ using namespace utils;
void bench_mt(int howmany, std::shared_ptr<spdlog::logger> log, int thread_count); void bench_mt(int howmany, std::shared_ptr<spdlog::logger> log, int thread_count);
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4996) //disable fopen warning under msvc
#endif // _MSC_VER
int count_lines(const char *filename) int count_lines(const char *filename)
{ {
int counter = 0; int counter = 0;
...@@ -40,6 +45,11 @@ int count_lines(const char *filename) ...@@ -40,6 +45,11 @@ int count_lines(const char *filename)
return counter; return counter;
} }
#ifdef _MSC_VER
#pragma warning(pop)
#endif
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
...@@ -148,3 +158,6 @@ void bench_mt(int howmany, std::shared_ptr<spdlog::logger> logger, int thread_co ...@@ -148,3 +158,6 @@ void bench_mt(int howmany, std::shared_ptr<spdlog::logger> logger, int thread_co
auto delta_d = duration_cast<duration<double>>(delta).count(); auto delta_d = duration_cast<duration<double>>(delta).count();
spdlog::info("Elapsed: {} secs\t {:n}/sec", delta_d, int(howmany / delta_d)); spdlog::info("Elapsed: {} secs\t {:n}/sec", delta_d, int(howmany / delta_d));
} }
async_bench.cpp
Displaying async_bench.cpp.
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment