C++获取系统时间1970年1月1日到现在的毫秒数

#include <iostream>
#include <time.h>
#include <sys/timeb.h>
using namespace std; 
void CMyTime::GetMsTime()


{


   long long time_last;  
    time_last = time(NULL);     //总秒数
   struct timeb t1;  
   ftime(&t1); 
    CString strTime;
    strTime.Format(_T("%lldms"), t1.time * 1000 + t1.millitm);  //总毫秒数
    AfxMessageBox(strTime); 
}


原文地址:https://www.cnblogs.com/hzcya1995/p/13318467.html