16 return new LV::Time (LV::Time::now ());
19 VisTime *visual_time_new_with_values (
long sec,
long nsec)
26 visual_return_val_if_fail (src !=
nullptr,
nullptr);
31 void visual_time_free (
VisTime *
self)
36 void visual_time_set (
VisTime *
self,
long sec,
long nsec)
38 visual_return_if_fail (
self !=
nullptr);
46 visual_return_if_fail (
self !=
nullptr);
47 visual_return_if_fail (src !=
nullptr);
50 self->nsec = src->
nsec;
53 void visual_time_get_now (
VisTime *
self)
55 visual_return_if_fail (
self !=
nullptr);
57 *
self = LV::Time::now ();
62 visual_return_if_fail (diff !=
nullptr);
63 visual_return_if_fail (time1 !=
nullptr);
64 visual_return_if_fail (time2 !=
nullptr);
66 *diff = *time1 - *time2;
71 visual_return_val_if_fail (
self !=
nullptr, FALSE);
72 visual_return_val_if_fail (ref !=
nullptr, FALSE);
77 double visual_time_to_secs (
VisTime *
self)
79 visual_return_val_if_fail (
self !=
nullptr, 0.0);
81 return self->to_secs ();
84 uint64_t visual_time_to_msecs (
VisTime *
self)
86 visual_return_val_if_fail (
self !=
nullptr, 0);
88 return self->to_msecs ();
91 uint64_t visual_time_to_usecs (
VisTime *
self)
93 visual_return_val_if_fail (
self !=
nullptr, 0);
95 return self->to_usecs ();
98 void visual_usleep (uint64_t usecs)
108 void visual_timer_free (
VisTimer *
self)
113 void visual_timer_reset (
VisTimer *
self)
115 visual_return_if_fail (
self !=
nullptr);
120 void visual_timer_start (
VisTimer *
self)
122 visual_return_if_fail (
self !=
nullptr);
127 void visual_timer_stop (
VisTimer *
self)
129 visual_return_if_fail (
self !=
nullptr);
134 int visual_timer_is_active (
VisTimer *
self)
136 visual_return_val_if_fail (
self !=
nullptr, FALSE);
138 return self->is_active ();
143 visual_return_if_fail (
self !=
nullptr);
144 visual_return_if_fail (time !=
nullptr);
146 *time =
self->elapsed ();
149 double visual_timer_elapsed_secs (
VisTimer *
self)
151 visual_return_val_if_fail (
self !=
nullptr, 0.0);
153 return self->elapsed ().to_secs ();
156 uint64_t visual_timer_elapsed_msecs (
VisTimer *
self)
158 visual_return_val_if_fail (
self !=
nullptr, 0);
160 return self->elapsed ().to_msecs ();
163 uint64_t visual_timer_elapsed_usecs (
VisTimer *
self)
165 visual_return_val_if_fail (
self !=
nullptr, 0);
167 return self->elapsed ().to_usecs ();
172 visual_return_val_if_fail (
self !=
nullptr, FALSE);
174 return self->elapsed() > *time;
177 int visual_timer_is_past2 (
VisTimer *
self,
long sec,
long nsec)
179 visual_return_val_if_fail (
self !=
nullptr, FALSE);
181 return self->elapsed () >
LV::Time (sec, nsec);