… | |
… | |
98 | Libev represents time as a single floating point number, representing the |
98 | Libev represents time as a single floating point number, representing the |
99 | (fractional) number of seconds since the (POSIX) epoch (somewhere near |
99 | (fractional) number of seconds since the (POSIX) epoch (somewhere near |
100 | the beginning of 1970, details are complicated, don't ask). This type is |
100 | the beginning of 1970, details are complicated, don't ask). This type is |
101 | called C<ev_tstamp>, which is what you should use too. It usually aliases |
101 | called C<ev_tstamp>, which is what you should use too. It usually aliases |
102 | to the C<double> type in C, and when you need to do any calculations on |
102 | to the C<double> type in C, and when you need to do any calculations on |
103 | it, you should treat it as such. |
103 | it, you should treat it as some floatingpoint value. Unlike the name |
|
|
104 | component C<stamp> might indicate, it is also used for time differences |
|
|
105 | throughout libev. |
104 | |
106 | |
105 | =head1 GLOBAL FUNCTIONS |
107 | =head1 GLOBAL FUNCTIONS |
106 | |
108 | |
107 | These functions can be called anytime, even before initialising the |
109 | These functions can be called anytime, even before initialising the |
108 | library in any way. |
110 | library in any way. |
… | |
… | |
1220 | |
1222 | |
1221 | The current reschedule callback, or C<0>, if this functionality is |
1223 | The current reschedule callback, or C<0>, if this functionality is |
1222 | switched off. Can be changed any time, but changes only take effect when |
1224 | switched off. Can be changed any time, but changes only take effect when |
1223 | the periodic timer fires or C<ev_periodic_again> is being called. |
1225 | the periodic timer fires or C<ev_periodic_again> is being called. |
1224 | |
1226 | |
|
|
1227 | =item ev_tstamp at [read-only] |
|
|
1228 | |
|
|
1229 | When active, contains the absolute time that the watcher is supposed to |
|
|
1230 | trigger next. |
|
|
1231 | |
1225 | =back |
1232 | =back |
1226 | |
1233 | |
1227 | Example: Call a callback every hour, or, more precisely, whenever the |
1234 | Example: Call a callback every hour, or, more precisely, whenever the |
1228 | system clock is divisible by 3600. The callback invocation times have |
1235 | system clock is divisible by 3600. The callback invocation times have |
1229 | potentially a lot of jittering, but good long-term stability. |
1236 | potentially a lot of jittering, but good long-term stability. |