- 论坛徽章:
- 0
|
从老外那里得知
gcc 4.2 toolchain has support to do ARM vfp
the compiler options you would want to use would be: -mfpu=vfp -mfloat-abi=softvfp
我的toolchain才3.4.3 版本的,应该还不直持硬件的浮点单元。
上面用arm-linux-objdump -p 看格式是错误的方法。
关键部分我再慢慢详细的测一下
- static void timestamp( char* buffer) {
- static int startSecond = 0;
- static int startMs = 0;
- struct timeval tv;
- int deltaSecond, deltaMs;
- gettimeofday(&tv, NULL);
- /* Running for the first time? */
- if(startSecond == 0) {
- /* Copy to prev so that we get 0 delta. */
- startSecond = tv.tv_sec;
- startMs = tv.tv_usec;
- }
- /* Calculate the delta (in microseconds). */
- deltaSecond = tv.tv_sec - startSecond;
- deltaMs = tv.tv_usec - startMs;
- /* Create the string giving offset from start in seconds. */
- snprintf(buffer, BUFFER_SIZE, "%u.%u",deltaSecond,deltaMs);
- }
复制代码
[ 本帖最后由 magicboatrocket 于 2009-10-21 23:18 编辑 ] |
|