散分,顺便问一简单问题
已知当前时间为2007-9-14 15:36
程序中可以获得系统当前时间
如下
CTime at = CTime::GetCurrentTime();
int nYear = at.GetYear();
int nMonth = at.GetMonth();
int nDay = at.GetDay();
int nHour = at.GetHour();
int nMin = at.GetMinute();
int nSec = at.GetSecond();
year ,month, day ,hour ,minute ,second ,类型都为int 型,怎么计算时间差,假设要让差值等于20毫秒作为判断条件,系统时间是变化的,但比较接近我给出的时间
该怎么计算这个差值呢 ??
给出详细的解决方案更好了 ,这个问题不是很复杂哦 ,想看下各位有哪些高招。