Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Basic4ppc Wishlist > Bug Reports
Documentation Wiki Register Members List B4P 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, 05:44 PM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 366
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, 06:05 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,701
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
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, 11:12 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
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, 12:14 PM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 366
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, 12:21 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
Default

Are your sure? My help file Time->Overview is correct.
Reply With Quote
  #6 (permalink)  
Old 12-09-2007, 12:24 PM
Basic4ppc Veteran
 
Join Date: Nov 2007
Posts: 366
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, 01:40 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 6,072
Awards Showcase
Innovator medal Beta Tester Forum Contributer 
Total Awards: 3
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 Off
Pingbacks are Off
Refbacks are On

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


All times are GMT. The time now is 03:04 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0