[prev in list] [next in list] [prev in thread] [next in thread] 

List:       nsbasic-palm
Subject:    [nsbasic-palm] Re: Sub-second Times
From:       "ephippigeruk" <dmk2 () st-and ! ac ! uk>
Date:       2002-06-28 10:08:10
Message-ID: afhcia+jf86 () eGroups ! com
[Download RAW message or body]


I would like to thanks Douglas for your very helpful comments on
getting subsecond times. While it would be very useful to get a more
accurate time using Now() the sysinfo method has met my requirements
of recording the interval between events. In my case the event being
the pressing of various buttons to record behaviour when the crickets
I study change behaviour.

Thanks
Dave

--- In nsbasic-palm@y..., Douglas Handy <dhandy1@b...> wrote:
> Dave,
> 
> >I would like to time stamp button press events to a greater accuracy
> >than the whole second resolution given by the now() function.
> 
> Palm OS doesn't offer a direct method to do so, AFAIK.  There is a
system
> counter you can read which is in "ticks" -- typically 1/100 of a
second -- but
> its basis is not tied to the system clock.  It is not number of
ticks since the
> last reset operation -- excluding time the device has been asleep or
powered
> off.  NSB makes this available via the SysInfo(1) .
> 
> So it depends on what you are tying to do.  If you are making a
stopwatch type
> functionality -- and the device will not auto-off during the process
-- you can
> use the between two successive calls to SysInfo(1) to find the
number of ticks
> between the calls.  Then divide this by SysInfo(2) to turn that into
a number of
> seconds.  On most devices SysInfo(2) returns 100.  In fact, I
*think* it does on
> all current devices and only the Mac emulator returns 60.  But in
theory you
> should not assume 100 ticks per second but use SysInfo(2) instead.
> 
> If what you want though is to store a timestamp value with more
precision than a
> single second, it will be tough.  There isn't even an API for this
which I can
> find, other than what maps to SysInfo(1), SysInfo(2), and Now(), etc.
> 
> Can you explain more what you are tyring to do?
> 
> Doug


Community email addresses:
 Post message: nsbasic-palm@yahoogroups.com 
 Subscribe:  nsbasic-palm-subscribe@yahoogroups.com 
 Unsubscribe:  nsbasic-palm-unsubscribe@yahoogroups.com  
 List owner:  nsbasic-palm-owner@yahoogroups.com 

Shortcut URL to this page:
 http://groups.yahoo.com/group/nsbasic-palm  

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic