|Related to : Error SEGV in test C code on elapsed time in ARM Cortex M4 processor|
|Get elapsed time as a formatted string|
If you have the elapsed time in milliseconds (ms), you can print the
time in mm:ss format in the following way:
QString out = QString("%1:%2").arg( ms / 60000 , 2, 10,
.arg((ms % 60000) / 1000, 2, 10,
|How to implement elapsed time by jiffies|
You can do something like this :
struct timeval start, finish;
// execute your processing here
delta_usecs = (finish.tv_sec - start.tv_sec) * 1000000 +
(finish.tv_usec - start.tv_usec);
Since you are working on ARM arch, it may help to check the available
resolution of your system timer by insmodi
|Calculate how many time (precision to millisecond) elapsed since 1970/1/1|
It appears with 124958371942, OP is counting centiseconds and not
milliseconds. There also is a timezone issue. It appears the 1970
timestamp is UTC and the 2009 date may be local.
Various approaches to cope with timezone differences.
A comon approach is to assume both the 2009/08/06 14:35:19.42 and
1970/01/01 00:00:00 are universal time. Another is that they are both
local time. The follow
|Problems with processor architecture (x86 vs any cpu)|
Check you build settings in detail. In addition to the architecture
choice, there is a "prefere 32 bit" checkbox. This checkbox is checked
by default for windows client applications, that's why your WinForms
application runs in 32 bit and works. Most likely your Windows Service
doesn't have that checked and therefore runs in 64 bit.
|C Pre-Processor Conditional Directive Precedence and Nesting|
Try this .. .
// some new code here that takes precedence over the other two
// some code here
// some other code here
Above is what I commonly use and should work with gcc for sure.
Not sure, but should work with visual c++ and other compilers.