C++常用库

2021-05-30 05:04

阅读:423

标签:seconds   second   class   nose   lis   type   int   const   time   

 

 

#include
    /// nanoseconds
    typedef duration<_glibcxx_chrono_int64_t nano>         nanoseconds;

    /// microseconds
    typedef duration<_glibcxx_chrono_int64_t micro>         microseconds;

    /// milliseconds
    typedef duration<_glibcxx_chrono_int64_t milli>         milliseconds;

    /// seconds
    typedef duration<_glibcxx_chrono_int64_t>             seconds;

    /// minutes
    typedef duration<_glibcxx_chrono_int64_t ratio>60>>   minutes;

    /// hours
    typedef duration<_glibcxx_chrono_int64_t ratio>3600>>  hours;

计时

const auto tp_1 = std::chrono::steady_clock::now();
matcher->match(desc_1, desc_2, matches);
const auto tp_2 = std::chrono::steady_clock::now();

const auto track_time = std::chrono::duration_cast<:chrono::milliseconds>(tp_2 - tp_1).count();
td::cout"match_time: ""ms" 

 

C++常用库

标签:seconds   second   class   nose   lis   type   int   const   time   

原文地址:https://www.cnblogs.com/xiaohuidi/p/14757673.html


评论


亲,登录后才可以留言!