Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide
translations



Rockbox mail archive

Subject: Re: DEV timer? GetTicks?

Re: DEV timer? GetTicks?

From: Minuk Choi <Choi.Minuk_at_verizon.net>
Date: Tue, 23 Sep 2003 00:56:50 -0400

Hey gang, I have the following lines

int t = current_tick;

while ((current_tick-t)<3600)
    something...

it's in a file in the plugin directory. When I try to compile, I get the
message that current_tick is an undefined reference. Am I forgetting
something?
-Mark

----- Original Message -----
From: "Björn Stenberg" <bjorn_at_haxx.se>
To: <rockbox_at_cool.haxx.se>
Sent: Monday, September 22, 2003 4:17 AM
Subject: Re: DEV timer? GetTicks?


> Minuk Choi wrote:
> > Hiya, I'm playing around with the source files... and I was
> > wondering... is there a way to grab the current number of ticks or
> > timer?
>
> Yes. The variable 'current_tick' is incremented HZ times per second.
>
> > I want to write something that implements a time based (in milliseconds)
> > delay.
>
> You should use sleep(HZ/fraction) for that. Busy waiting does not work
since we don't use preemptive scheduling.
>
> --
> Björn
>
Received on 2003-09-23

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy