How to convert from Ticks to date&time?

D

David

We only know the system ticks count, but we have no date or time function.

So we need the source code about solving the problem. I have googled several
times and no good results. can u help me?

Thanks in advance.
 
M

Mark McIntyre

We only know the system ticks count, but we have no date or time function.

CLOCKS_PER_SEC might be useful. Bear in mind that system ticks may not
represent wall-clock time, but CPU time.
So we need the source code about solving the problem. I have googled several
times and no good results.

Once you have it in seconds, the rest is easy.
 
T

Tim Prince

David said:
We only know the system ticks count, but we have no date or time function.

So we need the source code about solving the problem. I have googled several
times and no good results. can u help me?
Unless you have a system function which quotes tick rate, you must use a
test loop to calibrate it yourself.

If you don't have a C implementation sufficient to provide time of day
information, you are far outside the scope of the newsgroup.
 
E

Eric Sosman

Tim said:
Unless you have a system function which quotes tick rate, you must use a
test loop to calibrate it yourself.

If you don't have a C implementation sufficient to provide time of day
information, you are far outside the scope of the newsgroup.

A "freestanding environment" (section 5.1.2.1) need not
provide a complete library implementation.

The O.P.'s fundamental problem is that he hasn't specified
what a "system tick" is. If it's a regularly-changing count
with a known zero point, conversion to human-readable form is
fairly straightforward. If it's a regularly-changing count
whose zero is not fixed (e.g., "most recent power-up"), the
conversion is impossible without further information. If it's
some more exotic quantity ("number of instruction issues since
power-up"), the conversion may be impossible altogether.

So, O.P.: What's a "system tick?" Something that carries
"system Lyme disease?"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top