HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Is there a way to compute time without system clock

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
withoutcomputesystemwaytimeclockthere

Problem

I was thinking about any method where we can use RAM I/O speed, to calculate time, let's say for example:
RAM transfer rate is 1000 MB/s, so when it's half full (about 500 M Bytes written), by dividing 500 by 1000 we get the time which is epoch + 0.5 seconds
so all in all we have three routines:

  • one for writing data (zeros for example) into RAM



  • another one for checking when a specific size is full



  • and the third for calculating time




Note: Sorry if it sounds stupid, because this is not my study field,

Solution

You could try to measure time from RAM transfer rates. You'd need to know the precise clock ratio between the RAM and the CPU. There would have to be a precise clock ratio; I don't think this is the case on typical PC architectures as the RAM and the CPU have their own clock and I'm not sure the RAM peak transfer rate is a constant.

You'd need to block all other sources of interrupts, because if the CPU is responding to some other interrupt, it may notice too late that the RAM is ready, so it would tend to drift.

The nail in the coffin is that while the CPU is waiting for the RAM, it isn't doing anything else. The same objection goes for anything that requires the CPU to perform computations to obtain the time — a CPU that does nothing but measure the time has no time left to do useful things.

Context

StackExchange Computer Science Q#19917, answer score: 5

Revisions (0)

No revisions yet.