It seems like the browser you are using has JavaScript disabled. As a result, the site will not function properly. We really want you to enable it so you may experience our site as we intended it. If you have no idea what we are talking about or if you need help, visit http://www.enable-javascript.com×
This website uses cookies. By continuing to browse this site you are agreeing to our use of cookies. Find out more on our cookie page.×

Oops, it seems like you're using an old browser that we do not fully support. If you're able to, please upgrade your browser here.×
This website uses cookies. By continuing to browse this site you are agreeing to our use of cookies. Find out more on our cookie page.×

Since:

Arguments:

The type of timer to arm if you aren't disarming the timer. The
valid bits include:

TIMER_ABSTIME — the it_value represents an absolute expiration date in seconds and
nanoseconds from 1970. If the date specified has already passed, the
function succeeds and the expiration notice is made.

If
you don't set this bit, the it_value
represents a relative expiration period that's offset from the current
system time by the specified number of seconds and nanoseconds.

The following are BlackBerry 10 OS extensions:

TIMER_TOLERANCE — specify the amount of the
tolerance to allow the kernel in low-power situations. You can't set this
and TIMER_ABSTIME in the same call.

TIMER_PRECISE — exclude the timer from timer
harmonization. You can OR this into the flags if you're setting an
expiration time (i.e., you didn't specify TIMER_TOLERANCE).

value

A pointer to a itimerspec structure that specifies
the value that you want to set for the timer's time until expiry, or the timer tolerance, depending on the
flags.
For more information about this structure, see
timer_gettime().

If you specify the TIMER_TOLERANCE flag, this argument can be NULL.

ovalue

NULL, or a pointer to a itimerspec
structure that the function fills in with the timer's former time until
expiry or tolerance, depending on the flags.

Library:

libc

Use the -l c option to
qcc
to link against this library.
This library is usually included automatically.

Description:

The timer_settime() function sets the expiration time of the
timer specified by timerid from the it_value member
of the value argument. If the it_value structure
member of value is zero, then the timer is disarmed.

The timer_settime() function rounds up time values that are
between two consecutive nonnegative integer multiples of the
resolution of the specified timer to the larger multiple of the
resolution.

If the it_interval member of value is nonzero, then
it specifies a repeat rate that is added to the timer once the
it_value period has expired. Subsequently, the timer is
automatically rearmed, causing it to become continuous with a period
of it_interval.

If the ovalue parameter isn't NULL, then on return
from this function it contains a value representing the previous amount
of time left before the timer was to have expired, or zero if the timer
was disarmed. The previous interval timer period is also stored in the
it_interval member.

The timerid is local to the calling process, and must have
been created using timer_create().

As a BlackBerry 10 OS extension, if you specify the TIMER_TOLERANCE flag, then:

If value isn't NULL, the it_value member specifies the
amount of tolerance, in nanoseconds, that the kernel is allowed in low-power situations.
The kernel uses the expiry time plus the tolerance value to decide if it should enter tickless operation
or a low-power mode.

If ovalue isn't NULL, the function sets the it_value
member to the previous tolerance.

You can set the tolerance at any time without affecting the
active/inactive status of the timer. For more information, see "
Clocks, timers, and power management
" in the Tick, Tock: Understanding the Microkernel's Concept of Time chapter of the
BlackBerry 10 OSProgrammer's Guide.

Returns:

Errors:

EFAULT

A fault occurred trying to access the buffers provided.

EINVAL

The timer timerid isn't attached to the calling process
or the number of nanoseconds specified by the tv_nsec member
of one of the timespec
structures in the itimerspec structure pointed to by
value is less than zero or greater than or equal to 1000 million.

1. Choose your focus

This is the focus controller. Use this controller to choose your primary development approach (Cascades or Core).

By selecting a focus, you get to decide what content should be front and center on the site.

2. Download the tools

Before you start developing, you'll need to visit the Downloads tab. Here you'll find downloads for the BlackBerry 10 Native SDK, BlackBerry 10 Device Simulator, and some other useful tools.

3. Try the sample apps

Now featuring a filter control, the Sample apps tab allows you to search for samples by name or by feature.

Select either the Core or Cascades check boxes to display the samples relevant to your focus.

4. Educate yourself

The Documentation tab contains tons of examples, tutorials, and best practices to guide you along the path towards building an awesome app.

The documentation for your preferred focus always appears at the top of the left-hand navigation, but you can still access the rest of the documentation at the bottom.

5. Start developing

The Reference tab is where you'll find essential details about how to use our APIs.

You can use the left-hand navigation to choose how you would like to browse the reference: by module, by topic, or alphabetically. If you have an idea of what you are looking for, start typing it in the Filter box.