Defines timespec_add
, timespec_sub
and timespec_compare
and their
timeval counterparts. struct timespec
is more desirable, where available,
for improved precision in its representation.
This library defines mulle_timeinterval_t
which will be used as
NSTimeInterval
in mulle-objc.
Release Version | Release Notes |
---|---|
RELEASENOTES |
On Linux this library implicitly defines _GNU_SOURCE
to get the
CLOCK_REALTIME
and CLOCK_MONOTONIC
constants.
This library also defines these types based on mulle_timeinterval_t
.
mulle_calendartime_t
is to be used for keeping calendar related timestamps.
mulle_absolutetime_t
is to be used for animation timestamps
mulle_relativetime_t
is to be used for keeping delays and other relative quantities
These added types are mostly there to make code more readable, so that you
immediately know if a mulle_timeinterval_t
contains, say a delay of 0.1s
or the date of "now + 0.1s".
Caution: do not mix mulle_calendartime_t
and mulle_calendartime_t
Datatype | Description |
---|---|
mulle_timeinterval_t |
absolute or relative time stored as a double |
mulle_absolutetime_t |
a timestamp |
struct mulle_absolutetimerange |
an absolute time range |
mulle_calendartime_t |
a date value like today |
struct mulle_calendartimerange |
an absolute date range, like today until tomorrow |
mulle_relativetime_t |
a quantity of time like 10s |
struct mulle_relativetimerange |
a time range of relative times, like delay, duration |
This project is a component of the mulle-core library. As such you usually will not add or install it
individually, unless you specifically do not want to link against
mulle-core
.
Use mulle-sde to add mulle-time to your project:
mulle-sde add github:mulle-core/mulle-time
To only add the sources of mulle-time with dependency sources use clib:
clib install --out src/mulle-core mulle-core/mulle-time
Add -isystem src/mulle-core
to your CFLAGS
and compile all the sources that were downloaded with your project.
Use mulle-sde to build and install mulle-time and all dependencies:
mulle-sde install --prefix /usr/local \
https://github.com/mulle-core/mulle-time/archive/latest.tar.gz
Install the requirements:
Requirements | Description |
---|---|
mulle-c11 | ๐ Cross-platform C compiler glue (and some cpp conveniences) |
Download the latest tar or zip archive and unpack it.
Install mulle-time into /usr/local
with cmake:
cmake -B build \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DCMAKE_PREFIX_PATH=/usr/local \
-DCMAKE_BUILD_TYPE=Release &&
cmake --build build --config Release &&
cmake --install build --config Release
Nat! for Mulle kybernetiK