comp.lang.ada
 help / color / mirror / Atom feed
* Ada.Real_Time Vs. Ada.Calendar
@ 2006-11-22 15:24 markp
  2006-11-22 17:02 ` Jeffrey R. Carter
  0 siblings, 1 reply; 3+ messages in thread
From: markp @ 2006-11-22 15:24 UTC (permalink / raw)


I need to compare data types that are stored in Ada.Real_Time.Time and
Ada.Calendar.Time. I know I can get a seconds count from each package.
However, is it the same time base? Is it dependant on the hardware it
is run on?




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Ada.Real_Time Vs. Ada.Calendar
  2006-11-22 15:24 Ada.Real_Time Vs. Ada.Calendar markp
@ 2006-11-22 17:02 ` Jeffrey R. Carter
  2006-11-23  5:56   ` Simon Wright
  0 siblings, 1 reply; 3+ messages in thread
From: Jeffrey R. Carter @ 2006-11-22 17:02 UTC (permalink / raw)


markp wrote:
> I need to compare data types that are stored in Ada.Real_Time.Time and
> Ada.Calendar.Time. I know I can get a seconds count from each package.
> However, is it the same time base? Is it dependant on the hardware it
> is run on?

In general, you can't count on them having any meaningful relationship. 
Real_Time may be a count of ticks since the program started, for 
example, while Calendar must be a date and time CE.

How they are implemented is not specified, which is not surprising.

For a specific compiler and platform, you may be able to make use of 
compiler-dependent information to relate the two. GNAT, for example, 
defines both Time types as "new Duration". That doesn't guarantee that 
the stored values have the same meaning, though.

-- 
Jeff Carter
"We burst our pimples at you."
Monty Python & the Holy Grail
16



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Ada.Real_Time Vs. Ada.Calendar
  2006-11-22 17:02 ` Jeffrey R. Carter
@ 2006-11-23  5:56   ` Simon Wright
  0 siblings, 0 replies; 3+ messages in thread
From: Simon Wright @ 2006-11-23  5:56 UTC (permalink / raw)


"Jeffrey R. Carter" <spam.not.jrcarter@acm.not.spam.org> writes:

> In general, you can't count on them having any meaningful
> relationship. Real_Time may be a count of ticks since the program
> started, for example, while Calendar must be a date and time CE.

And I don't think it would be right to expect the relationship to be
constant, either -- Ada.Calendar might be synchronised with an
external time shource and might not be monotonic, whereas Real_Time
ought to be monotonic.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-11-23  5:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-22 15:24 Ada.Real_Time Vs. Ada.Calendar markp
2006-11-22 17:02 ` Jeffrey R. Carter
2006-11-23  5:56   ` Simon Wright

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox