TICKIT_WATCH_TIMER_AT_EPOCH(3)
πΈ TICKIT_WATCH_TIMER_AT_EPOCH(3) πΈ
okay bestie, welcome to the Library Functions Manual page for TICKIT_WATCH_TIMER_AT_EPOCH(3) π buckle up, this one is short and sweet and honestly kind of iconic.
β¨ NAME β¨
tickit_watch_timer_at_* β invoke a callback at a fixed future time β°
so basically it's "hey bestie, do this thing for me at THIS exact moment" energy. fixed time. not "in a bit". a specific point in the future. periodt. π
π¦ SYNOPSIS π¦
#include <tickit.h>
typedef int TickitCallbackFn(Tickit *t, TickitEventflags flags,
void *info, void *user);
void *tickit_watch_timer_at_epoch(Tickit *t, time_t at,
TickitBindFlags flags, TickitCallbackFn *fn, void *user);
void *tickit_watch_timer_at_tv(Tickit *t, const struct timeval *at,
TickitBindFlags flags, TickitCallbackFn *fn, void *user);
and then, the moment of truth:
Link with -ltickit.
yeah you gotta link with -ltickit or nothing happens, no cap. π₯
π DESCRIPTION π
The tickit_watch_timer_at_*() family of functions registers a callback function to be invoked by the toplevel event loop at a fixed time in the future. A registered callback will be invoked by a running call to tickit_run(3). β¨
The callback function will be invoked once, and then destroyed afterwards. one and done, like a situationship. π Each function returns an opaque pointer value which serves to identify this instance. The info pointer will be NULL. (yes, literally NULL, don't come for me.)
When invoked, the callback function is always passed both TICKIT_EV_FIRE and TICKIT_EV_UNBIND flags to its flags argument. If the callback had been registered with the TICKIT_BIND_DESTROY flag, then it will also be invoked with the TICKIT_EV_DESTROY flag if it has not yet been invoked by the time the toplevel instance is destroyed. π«Ά
If cancelled by tickit_watch_cancel(3) the callback function is invoked with just the TICKIT_EV_UNBIND flag if it had been registered with TICKIT_BIND_UNBIND.
fr fr, read that flags part twice. the TICKIT_EV_* flags are the whole plot twist and you don't wanna be surprised by them mid-debug π
π RETURN VALUE π
tickit_watch_timer_at_epoch() and tickit_watch_timer_at_tv() return an opaque identifier pointer. π
that's it. that's the whole return value. an opaque pointer. mysterious. main character energy honestly. π
π SEE ALSO π
tickit_new_stdio(3)tickit_watch_timer_after_msec(3)tickit_watch_later(3)tickit_watch_signal(3)tickit_watch_process(3)tickit_watch_cancel(3)tickit(7)
go read them, iykyk, they're all part of the same little watch-family friend group π
kisses, this was TICKIT_WATCH_TIMER_AT_EPOCH(3) from the Library Functions Manual β stay hydrated, link with -ltickit, and don't forget to cancel your watches bestie π§π
π¦ where this page comes from
- alpine 3.24: libtickit-doc 0.4.6-r0 Β· MIT
- debian bookworm: libtickit-dev 0.4.3-1 Β· MIT
- debian trixie: libtickit-dev 0.4.3-2 Β· MIT
- fedora 43: libtickit-devel 0.4.5-2.fc43 Β· MIT
- fedora 43: libtickit-devel 0.4.5-2.fc43 Β· MIT
- fedora 44: libtickit-devel 0.4.5-3.fc44 Β· MIT
- fedora 44: libtickit-devel 0.4.5-3.fc44 Β· MIT
- nixos 26.05: libtickit 0.4.5
- nixpkgs unstable: libtickit 0.4.6
- ubuntu noble: libtickit-dev 0.4.3-1.1build1 Β· MIT
- ubuntu questing: libtickit-dev 0.4.3-2
- ubuntu resolute: libtickit-dev 0.4.3-2build1 Β· MIT
- ubuntu stonking: libtickit-dev 0.4.3-2build1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms