refactor, libc made optional
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
#include "../std.h"
|
||||
#include "timer.h"
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#define __USE_POSIX199309 1
|
||||
#include <time.h>
|
||||
|
||||
/* TODO: Rename to posix.c */
|
||||
|
||||
uint64_t com_timer_count_ns(void) {
|
||||
struct timespec time;
|
||||
clock_gettime(CLOCK_MONOTONIC, &time);
|
||||
@@ -15,5 +13,5 @@ uint64_t com_timer_count_ns(void) {
|
||||
void com_timer_profile(uint64_t starttime, const char *what) {
|
||||
uint64_t const endtime = com_timer_count_ns();
|
||||
uint64_t const diff = endtime - starttime;
|
||||
printf("profile \"%s\" took %fms\n", what, (double)diff / 1000000);
|
||||
com_std_printf("profile \"%s\" took %fms\n", what, (double)diff / 1000000);
|
||||
}
|
||||
Reference in New Issue
Block a user