Improve some timespec functions

This commit is contained in:
Justine Tunney 2022-09-19 16:13:37 -07:00
parent 2395a9eced
commit 6e582d245b
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
6 changed files with 16 additions and 10 deletions

View file

@ -16,15 +16,12 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/assert.h"
#include "libc/calls/struct/timespec.h"
#include "libc/sysv/consts/clock.h"
#include "libc/sysv/consts/nr.h"
#include "libc/time/time.h"
struct timespec _timespec_real(void) {
int ax, dx;
struct timespec ts;
ax = clock_gettime(CLOCK_REALTIME_FAST, &ts);
if (ax) notpossible;
_npassert(!clock_gettime(CLOCK_REALTIME_FAST, &ts));
return ts;
}