|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
Anonymous Guest
|
Posted: Thu Jul 13, 2006 4:31 pm Post subject: Timing problem |
|
|
Hello everybody,
I am puzzled with the following.
Trying to get an accurate estimation of time consumption of a certain algorithm, I was using two possible measurements: DATE_AND_TIME and SYSTEM_CLOCK.
Consider the following piece of code:
CALL DATE_AND_TIME (start_date,start_time,zone,values)
CALL SYSTEM_CLOCK (count_start,count_rate,count_max)
millisecs_start = CALC_MILLISECS (values) ! user-defined function
<STUFF TO DO>
CALL DATE_AND_TIME (stop_date,stop_time,zone,values)
CALL SYSTEM_CLOCK (count_stop,count_rate,count_max)
millisecs_stop = CALC_MILLISECS (values) ! user-defined function
WRITE(6,*) millisecs_stop-millisecs_start, count_start-count_stop ! count seems to be decreasing, but hey, no problem.
The results produced were:
elapsed millisecs = 44312
elapsed clock tics = 829019
The funny thing is that COUNT_RATE = 10000, and this is not in accordance with the above results (which rather indicate a CLOCK_RATE of about 18700...)
Any explanation, anybody?
Many thanks!
Lucas. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7927 Location: Salford, UK
|
Posted: Fri Jul 14, 2006 2:04 am Post subject: Timing problem |
|
|
Lucas
A question like yours about SYSTEM_CLOCK has already been raised on a different forum thread and is still outstanding. In the mean time...
COUNT_RATE is an internal fixed scaling factor that is used when calculating the results.
I cannot think of a way that it might be used at programming level.
The arguments of SYSTEM_CLOCK should be of the same INTEGER KIND and there may well be cases when KIND=4 (INTEGER* is required.
The /TIMING compiler option may be of interest and relevance. See the help file for further details. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|