Main interface function rapid cycling to write data in the database
Write_data (pBuffer2, temp1, length1);
The temp1 in single CPP in a function as a centralized processing
Void unix_to_date (unsigned long long time, char * date)
{
Unsigned long long second=time/1000;
Unsigned int milli=time % 1000;
Time_t timeT=(time_t) second;
If (timeT> 100000000000)
{//output debugging information
}
* struct tm ptime.
Ptime=localtime (& amp; TimeT);
If (ptime==NULL)
{//output debugging information
}
Strftime (date, DATE_TIME_STRING_LENGTH + 1, "% % Y - m - H: % d % % m: % S", ptime);//the data here is need to eventually return to the time data
//strftime (date, 100, "% % Y - m - H: % d % % m: % S", ptime);
Char milli_str [5].
Sprintf (milli_str ". % 3 d ", milli);
Strcat (date, milli_str);
}
During the execution of a program (write very fast cycle), to a certain time will collapse, the problem is ptime null values, view timeT and transfer time is a great value, at this time how to examine the problems in the main interface function value, add supervisors tips beyond the scope of!!!!!
Because the program runs quickly, can't see what main interface to which the problem of for loops, and the cycle number is a big
CodePudding user response:
Add ASSERT, debug version will play a window, and then click retry can see the call stackIf (XXXXXX)
{
//parameter error
ASSERT (FALSE);
}
CodePudding user response: