Std::chrono examples

From kangssu
Jump to: navigation, search

chrono examples

#include <chrono>

static uint64_t getTimeStamp() { 
    auto unix_timestamp = std::chrono::seconds(std::time(NULL)).count(); 
    return unix_timestamp;
    //int unix_timestamp_x_1000 = std::chrono::milliseconds(unix_timestamp).count(); 
    //return unix_timestamp_x_1000;
}