zoukankan      html  css  js  c++  java
  • 将两个时间间隔以毫秒的形式来表示

    下面是MSDN的提示:  
      Remarks  
      It   is   not   recommended   that   you   add   and   subtract   values   from   the   SYSTEMTIME   structure   to   obtain   relative   times.   Instead,   you   should    
       
      1、Convert   the   SYSTEMTIME   structure   to   a   FILETIME   structure.    
      2、Copy   the   resulting   FILETIME   structure   to   a   LARGE_INTEGER   structure.    
      3、Use   normal   64-bit   arithmetic   on   the   LARGE_INTEGER   value.    
       
      所以可以这样做:  
      FILETIME   ftStart,   ftEnd;  
      SystemTimeToFileTime(&m_stStart,   &ftStart);  
      SystemTimeToFileTime(&m_stEnd,   &ftEnd);  
       
      LARGE_INTEGER   liStart,   liEnd;  
      liStart.HighPart   =   ftStart.dwHighDateTime;  
      liStart.LowPart   =   ftStart.dwLowDateTime;  
      liEnd.HighPart   =   ftEnd.dwHighDateTime;  
      liEnd.LowPart   =   ftEnd.dwLowDateTime;  
       
      __int64   llUsedTime   =   (liEnd.QuadPart   -   liStart.QuadPart)/10000;   //you   want   time
  • 相关阅读:
    查询论文引用次数及格式和相似论文的方法
    JAVA日期加减运算
    luogu2833 等式
    luogu2261 [CQOI2007] 余数之和
    luogu2822 组合数问题
    luogu3942 将军令 贪心
    luogu3941 入阵曲
    luogu3939 数颜色
    二分查找总结
    luogu3938 斐波那契
  • 原文地址:https://www.cnblogs.com/strinkbug/p/778369.html
Copyright © 2011-2022 走看看