zoukankan      html  css  js  c++  java
  • C/C++里边如何获得系统时间

    ms级:
    #include <windows.h>
    GetTickCount()

    ns级:
    #include <windows.h>
    QueryPerformanceFrequency()

    cycle级

    unsigned int timehi , timelo;
    __asm{
        rdtsc
        mov   timehi , edx;
        mov   timelo , eax;
    }
    return  ((int __int64)timehi << 32) + (__int64) timelo;


    在Linux下,分别是怎么样的呢?

    秒:
        time()
    微秒:
        gettimeofday()
    stick:
        /dev/rtc
    其他的不知道了

     提到:

    ////////////////////////////////////////////////////
    //开始计时
    //////////////////////////////////////////////////
        QueryPerformanceFrequency(&litmp);
    ////////////////////////////////////////////////////
    //结束计时
    //////////////////////////////////////////////////
        QueryPerformanceCounter(&litmp);

  • 相关阅读:
    ListView
    ScrollView-电影列表
    ScrollView
    Image组件
    TextInput
    Touchable类组件
    Text
    View
    FlexBox
    StyleSheet
  • 原文地址:https://www.cnblogs.com/dayouluo/p/122360.html
Copyright © 2011-2022 走看看