refactor, libc made optional

This commit is contained in:
veclavtlica
2026-09-14 12:21:49 +03:00
parent 26f6ba56e9
commit 1125073568
14 changed files with 178 additions and 152 deletions
+2 -4
View File
@@ -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);
}