Beispiel #1
1
static inline std::chrono::steady_clock::duration CurrentUptime()
{return MonoClock.now() - GlobalStart;}
Beispiel #2
0
 auto_timer(const std::string& prefix, uint64_t delivery) : prefix(prefix), delivery(delivery)
 {
     start_time = clock.now();
 }
Beispiel #3
0
    {
    case SIGSEGV:
        Log.report(logvisor::Fatal, "Segmentation Fault");
    case SIGILL:
        Log.report(logvisor::Fatal, "Bad Execution");
    case SIGFPE:
        Log.report(logvisor::Fatal, "Floating Point Exception");
    default:
        Log.report(logvisor::Fatal, "unknown signal %d", signum);
    }
}

std::vector<std::unique_ptr<ILogger>> MainLoggers;
std::atomic_size_t ErrorCount(0);
static std::chrono::steady_clock MonoClock;
static std::chrono::steady_clock::time_point GlobalStart = MonoClock.now();
static inline std::chrono::steady_clock::duration CurrentUptime()
{return MonoClock.now() - GlobalStart;}
std::atomic_uint_fast64_t FrameIndex(0);
std::recursive_mutex LogMutex;

static inline int ConsoleWidth()
{
    int retval = 80;
#if _WIN32
    CONSOLE_SCREEN_BUFFER_INFO info;
    GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &info);
    retval = info.dwSize.X - 1;
#else
    struct winsize w;
    if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &w) != -1)
Beispiel #4
0
BENCHMARK_RELATIVE(steady_clock, n) {
  while (n--) {
    auto t = steadyClock.now();
    folly::doNotOptimizeAway(t);
  }
}
Beispiel #5
-1
 ~auto_timer()
 {
     for (auto task : waited_task)
     {
         task->wait();
     }
     auto end_time = clock.now();
     std::cout << prefix << "throughput = " << delivery * 1000 * 1000 / std::chrono::duration_cast<std::chrono::microseconds>(end_time - start_time).count() << std::endl;
 }