forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CALL SYSTEM_CLOCK problem

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
DanRRight



Joined: 10 Mar 2008
Posts: 2819
Location: South Pole, Antarctica

PostPosted: Sat Apr 19, 2008 9:27 am    Post subject: CALL SYSTEM_CLOCK problem Reply with quote

In my new computer I got one annoyance. Now the code does not
give me correct time obtained this way

CALL SYSTEM_CLOCK (iclock,irate)
SecondsSinceTheMidnight = iclock/dble(irate)

And time goes back! I mean SecondsSinceTheMidnight decreasing all the way

What could be wrong?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7927
Location: Salford, UK

PostPosted: Sat Apr 19, 2008 3:38 pm    Post subject: Reply with quote

Problems with SYSTEM_CLOCK have been reported on some machines but so far I have not been able to reproduce this or make any progress towards a fix.
Back to top
View user's profile Send private message AIM Address
DanRRight



Joined: 10 Mar 2008
Posts: 2819
Location: South Pole, Antarctica

PostPosted: Sat Apr 19, 2008 10:51 pm    Post subject: Reply with quote

Is it worth to get newer version of Salflibc (mine are ~5 years old) ?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7927
Location: Salford, UK

PostPosted: Sun Apr 20, 2008 8:34 am    Post subject: Reply with quote

No I don't think it will make any difference.
Back to top
View user's profile Send private message AIM Address
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Tue Apr 22, 2008 3:20 am    Post subject: Reply with quote

Paul,

There is a requirement for integer*8 variables to solve this as the count_rate in some processors is > 2^31, ie -ve. On my 3ghz P4 the count_rate was 3ghz. system_clock should be changed to detect when count_rate is not a good value.

You can work around the problem by recognising the time step is going backwards and calculate the -ve factor to apply to the time coming out of SYSTEM_CLOCK. I did and it worked fine for that pc only.

My solution is to use an alternative routine. I use :-

! ELAPSED TIME CALLS
! fastest gettickcount winapi
! accurate QueryPerform winapi
!
! CPU TIME CALLS
! fastest cpu_clock@ salford
! accurate cpu_clock@ salford

John
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7927
Location: Salford, UK

PostPosted: Tue Apr 22, 2008 7:01 am    Post subject: Reply with quote

Thanks. I will take another look at this as soon as I can.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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