Quote:Because I need to be different :). Partically it is a performance issue, just from tests, I can definately see a speed improvement when using the integers only vs the floats or doubles. If I need to go down that road, I will. I'm just looking to see if there is an integer solution.
Oh lordy. In what situation is getting a timestamp absolutely time-critical?
The closest I've seen is an in-game profiler, which when used *everywhere* ends up fairly heavy. What you do in that case is store the raw undecoded RDTSC value without any kind of calculation at all, so it doesn't matter if the calculation takes 3 clocks more or not.
You are being bitten by premature optimization!
BTW, again about the integer thing. To paraphrase some US senator (who was probably talking about the budget): here a billion, there a billion, pretty soon we're talking about real money.
Integer truncation during division will eventually add up to quite some errors. You could implement fixed-point arithmetic, but that would be utter madness, since FPU is faster and easier.
Quote:There is less precision in a double than in an int64.
True, but let's be realistic here.
1) 53 bits of mantissa give you 16 decimal places of accuracy. Let's write off 2 of them for fun (and calculations on your timestamps), 6 for microsecond precision, and that leaves 8 of range, which is enough to exactly represent something like 3 months.
2) assuming we are talking about relative timestamps as used in games, that is PLENTY.
Do not allow yourself to be swayed by arguments applying to something else entirely. TomF is talking about storing game coordinates - numbers that tend to get very large (unlike relative timestamps).