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
  • 相关阅读:
    Python学习-if条件语句
    Python学习-变量
    认识Python
    win7分盘
    mysql环境变量配置
    mysql的下载及配置
    c# excel xls保存
    js 在线引用
    js layer.js
    vue day3 bootstrap 联动下拉
  • 原文地址:https://www.cnblogs.com/strinkbug/p/778369.html
Copyright © 2011-2022 走看看