---
name: "ualarm"
section: "3"
platform: "macos"
package: "Libc"
version: "1752.120.2"
release: "macOS 26.5"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/ualarm"
---

# ualarm(3)

schedule signal after specified time

## NAME

**ualarm** – schedule signal after specified time

## LIBRARY

Standard C Library (libc, -lc)

## SYNOPSIS

**#include \<unistd.h\>**

*useconds\_t*\

**ualarm**(*useconds\_t microseconds*, *useconds\_t interval*);

## DESCRIPTION

This is a simplified interface to [setitimer(2)](/setitimer/2.md).

The **ualarm**() function waits a count of *microseconds* before asserting the terminating signal SIGALRM. System activity or time used in processing the call may cause a slight delay.

If the *interval* argument is non-zero, the SIGALRM signal will be sent to the process every *interval* microseconds after the timer expires (e.g. after *microseconds* number of microseconds have passed).

Due to [setitimer(2)](/setitimer/2.md) restriction the maximum number of *microseconds* and *interval* is limited to 100,000,000,000,000 (in case this value fits in the unsigned integer).

## RETURN VALUES

When the signal has successfully been caught, **ualarm**() returns the amount of time left on the clock.

## NOTES

A microsecond is 0.000001 seconds.

## SEE ALSO

[getitimer(2)](/getitimer/2.md), [setitimer(2)](/setitimer/2.md), [sigaction(2)](/sigaction/2.md), [sigsuspend(2)](/sigsuspend/2.md), [alarm(3)](/alarm/3.md), [signal(3)](/signal/3.md), [sleep(3)](/sleep/3.md), [usleep(3)](/usleep/3.md)

## HISTORY

The **ualarm**() function appeared in 4.3BSD.
