mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-26 02:02:14 +02:00
Have monotic() return numbers offset from init time
This commit is contained in:
@@ -89,7 +89,9 @@ static inline double monotonic_(void) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
double monotonic() { return monotonic_(); }
|
static double start_time = 0;
|
||||||
|
|
||||||
|
double monotonic() { return monotonic_() - start_time; }
|
||||||
|
|
||||||
static PyObject*
|
static PyObject*
|
||||||
redirect_std_streams(PyObject UNUSED *self, PyObject *args) {
|
redirect_std_streams(PyObject UNUSED *self, PyObject *args) {
|
||||||
@@ -254,6 +256,7 @@ PyInit_fast_data_types(void) {
|
|||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
mach_timebase_info(&timebase);
|
mach_timebase_info(&timebase);
|
||||||
#endif
|
#endif
|
||||||
|
start_time = monotonic_();
|
||||||
|
|
||||||
if (m != NULL) {
|
if (m != NULL) {
|
||||||
if (!init_logging(m)) return NULL;
|
if (!init_logging(m)) return NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user