#include "utils.hpp" #include "logging.hpp" #ifndef WIN32 #include #endif #include namespace ngcore { // parallel netgen int id = 0, ntasks = 1; #ifdef WIN32 // windows does demangling in typeid(T).name() NGCORE_API std::string Demangle(const char* typeinfo) { return typeinfo; } #else NGCORE_API std::string Demangle(const char* typeinfo) { int status=0; try { char *s = abi::__cxa_demangle(typeinfo, nullptr, nullptr, &status); std::string result{s}; free(s); return result; } catch( const std::exception & e ) { GetLogger("utils")->warn("{}:{} cannot demangle {}, status: {}, error:{}", __FILE__, __LINE__, typeinfo, status, e.what()); } return typeinfo; } #endif double seconds_per_tick = [] () noexcept { auto tick_start = GetTimeCounter(); double tstart = WallTime(); double tend = WallTime()+0.001; // wait for 1ms and compare wall time with time counter while(WallTime()(tick_end-tick_start); }(); const std::chrono::time_point wall_time_start = TClock::now(); } // namespace ngcore