2 * Code taken from the Haskell "clock" package.
4 * Copyright (c) 2009-2012, Cetin Sert
5 * Copyright (c) 2010, Eugene Kirpichov
7 * OS X code was contributed by Gerolf Seitz on 2013-10-15.
12#include <mach/clock.h>
15void clock_gettime_darwin(clock_id_t clock, struct timespec *ts)
19 host_get_clock_service(mach_host_self(), clock, &cclock);
20 clock_get_time(cclock, &mts);
21 mach_port_deallocate(mach_task_self(), cclock);
22 ts->tv_sec = mts.tv_sec;
23 ts->tv_nsec = mts.tv_nsec;
26void clock_getres_darwin(clock_id_t clock, struct timespec *ts)
30 mach_msg_type_number_t count;
31 host_get_clock_service(mach_host_self(), clock, &cclock);
32 clock_get_attributes(cclock, CLOCK_GET_TIME_RES, (clock_attr_t)&nsecs, &count);
33 mach_port_deallocate(mach_task_self(), cclock);
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list