mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-24 19:22:11 +01:00
Add 'GTimeSpec' as 'struct timespec' equivalent
This commit is contained in:
parent
817b322ca7
commit
ac82e74895
@ -1319,6 +1319,9 @@ g_time_val_add
|
||||
g_time_val_from_iso8601
|
||||
g_time_val_to_iso8601
|
||||
|
||||
<SUBSECTION>
|
||||
GTimeSpec
|
||||
|
||||
<SUBSECTION>
|
||||
GDate
|
||||
GTime
|
||||
|
@ -134,6 +134,14 @@ length of the sleep.
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### STRUCT GTimeSpec ##### -->
|
||||
<para>
|
||||
|
||||
</para>
|
||||
|
||||
@tv_sec:
|
||||
@tv_nsec:
|
||||
|
||||
<!-- ##### STRUCT GDate ##### -->
|
||||
<para>
|
||||
Represents a day between January 1, Year 1 and a few thousand years in
|
||||
|
@ -1812,6 +1812,15 @@ g_get_current_time (GTimeVal *result)
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* GTimeSpec:
|
||||
*
|
||||
* Represents a precise time, with seconds and nanoseconds. This is
|
||||
* similar to POSIX <structname>struct timespec</structname>.
|
||||
*
|
||||
* Since: 2.28
|
||||
**/
|
||||
|
||||
static void
|
||||
g_main_dispatch_free (gpointer dispatch)
|
||||
{
|
||||
|
@ -33,6 +33,7 @@
|
||||
|
||||
#include <glibconfig.h>
|
||||
#include <glib/gmacros.h>
|
||||
#include <time.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@ -423,6 +424,14 @@ struct _GTimeVal
|
||||
glong tv_usec;
|
||||
};
|
||||
|
||||
typedef struct _GTimeSpec GTimeSpec;
|
||||
|
||||
struct _GTimeSpec
|
||||
{
|
||||
time_t tv_sec;
|
||||
glong tv_nsec;
|
||||
};
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
/* We prefix variable declarations so they can
|
||||
|
Loading…
x
Reference in New Issue
Block a user