krähemann.com

AgsTime

AgsTime — utility functions of time

Stability Level

Stable, unless otherwise indicated

Functions

Types and Values

Includes

#include <ags/lib/ags_time.h>

Description

Functions to help you dealing with time.

Functions

ags_time_get_uptime_from_offset ()

gchar *
ags_time_get_uptime_from_offset (guint offset,
                                 gdouble bpm,
                                 gdouble delay,
                                 gdouble delay_factor);

Calculates uptime from offset by applying factors bpm , delay and delay_factor giving you the result as string.

Parameters

offset

the offset in tics

 

bpm

the beats per minute

 

delay

the buffer time as delay

 

delay_factor

tact segmentation

 

Returns

the string containing the time, a minus sign is prepend if factors are invalid.

[transfer full]

Since: 3.0.0


ags_time_timeout_expired ()

gboolean
ags_time_timeout_expired (struct timespec *start_time,
                          struct timespec *timeout_delay);

Check start_time plus timeout_delay against current time.

Parameters

start_time

the start time timespec

 

timeout_delay

the delay timespec

 

Returns

TRUE if timeout expired, otherwise FALSE

Since: 3.0.0

Types and Values

AGS_TIME_ZERO

#define AGS_TIME_ZERO "0000:00.000"

AGS_USEC_PER_SEC

#define AGS_USEC_PER_SEC    (1000000) /* The number of msecs per sec. */

AGS_NSEC_PER_SEC

#define AGS_NSEC_PER_SEC    (1000000000) /* The number of nsecs per sec. */