Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Bug Reports
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Bug Reports Post about errors or bugs encountered.


Ticks, 1000000 in a second?


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-08-2007, 06:44 PM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 316
Awards Showcase
Beta Tester 
Total Awards: 1
Default Ticks, 1000000 in a second?

I wrote a stopwatch program using Ticks.
The help file says there is a million ticks in a second, but the counter/1000000 goes up by 10 a second???
Reply With Quote
  #2 (permalink)  
Old 12-08-2007, 07:05 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,143
Default

I will check it.
Anyway I recommend you to use the constants cTicksPerSecond / cTicksPerMinute / cTicksPerDay.
Reply With Quote
  #3 (permalink)  
Old 12-09-2007, 12:12 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,704
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Yes - I've come across this when benchmarking my Cray1 maths library. Although there ARE 10,000,000 (not 1,000,000) "ticks" in a second they are not real ticks. On my desktop "now" ticks about every 15.6ms (about 60hz - wonder why )and on my device only once per second. Each real tick adds enough virtual ticks to the tick counter to keep it in step with real time.

You can see this with something like

Then = now
Do
Next = now
Loop Until Next <> Then
msgbox(Next - Then)


Because of this, especially on the device, things that need time comparisons should ensure that they have enough "real" ticks to give a meaningful result with the precision required.
Reply With Quote
  #4 (permalink)  
Old 12-09-2007, 01:14 PM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 316
Awards Showcase
Beta Tester 
Total Awards: 1
Default so Helpfile wrong

ok if it is 10,000,000 ticks in a sec its just a typo in the helpfile not a bug in Basic4ppc
Reply With Quote
  #5 (permalink)  
Old 12-09-2007, 01:21 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,704
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Are your sure? My help file Time->Overview is correct.
Reply With Quote
  #6 (permalink)  
Old 12-09-2007, 01:24 PM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 316
Awards Showcase
Beta Tester 
Total Awards: 1
Default

help on the device says 1,000,000 ticks per sec
Reply With Quote
  #7 (permalink)  
Old 12-09-2007, 02:40 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,704
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by colin9876 View Post
help on the device says 1,000,000 ticks per sec
So it does - once I managed to find it! Sorry for doubting. If I look at the help I only ever use the desktop help as I can never find what I want on the device.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting date to ticks value mozaharul Questions & Help Needed 3 10-22-2008 10:51 AM
Ticks as a floating point value on XP (not 2000) lancaster Questions & Help Needed 4 04-09-2008 11:38 AM
Ticks truncated on the device? willisgt Questions & Help Needed 1 12-11-2007 06:29 PM


All times are GMT. The time now is 10:28 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0