16或32位C'时间'运行时库输出不同 [英] 16 or 32 bit C 'time' runtime library output differs

查看:82
本文介绍了16或32位C'时间'运行时库输出不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello开发人员,



我有一个用C编写的传统16位应用程序,它以UTC格式(Unix纪元时间)输出系统时间。



以下是代码段:

Hello developers,

I have a legacy 16 bit application written in C which outputs the system time in UTC format (Unix epoch time).

The following is the code snippet:

time_t  t ;
printf("%ld\n", time(&t)) ;





16位显示的时间与使用16位和32位Microsoft CL编译器构建的32位应用程序之间存在差异对于上面的代码。



有谁可以解释为什么会出现差异?



例如这里是示例同时执行,

32位:1404391074

16位:1404436063



谢谢,

Vishnu



There is a difference between the time displayed in seconds on 16 bit and 32 bit application built with 16 bit and 32 bit Microsoft CL compiler for the above code.

Can anyone explain why the difference occurs?

For example here is the example executed at the same time,
32 bit:1404391074
16 bit:1404436063

Thanks,
Vishnu

推荐答案

数据类型的表示在16位和32位编译器之间变化。 time()函数也不能给你准确/准确的时间。因为诸如CPU负载,ALU操作,运行的应用程序没有,运行的进程如何,每个进程的时间片等等因素会有所不同。

所以我希望它会有所不同。
Representation of data types varies between 16 bit and 32-bit compiler. Also time() function can't give you the exact/accurate time.something would be different because of factors like CPU load,ALU operations, no of Applications running, how any processes running, time slice for each process...etc.
So I hope it'll vary.


这篇关于16或32位C'时间'运行时库输出不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆