# timer tick algorithms

• 03-27-2002
Mohsinzb
timer tick algorithms
Can any body provide me with an algorithm which can convert timer ticks to absolute callender date and time. and from absolute date and time to timer ticks.

the PCs use these algorithms. Solutions in any programming languages are wellcommed.

Thankyou
mohsin
mohsinzb@hotmail.com
• 03-27-2002
Shiro
>Can any body provide me with an algorithm which can convert
>timer ticks to absolute callender date and time. and from
>absolute date and time to timer ticks.

I don't think it is possible to get calender date and time just from ticks. But if I remember well, it is possible to get the number of ticks since some date. And if you know the number of ticks, then you also need to know the number of ticks per second on your machine. And from then on, you can calculate back to date and time.

Assumption: start date is known / ticks per second is known

nr_of_ticks = get nr of ticks since date;
nr_of_seconds = nr_of_ticks / ticks per second;
nr_of_minutes = nr_of_seconds / 60;
etc.

>Solutions in any programming languages are wellcommed.

Algorithms are language independent.