Compare commits

...
8 Commits
Author SHA1 Message Date
schroederen 746b9b7219 Merge pull request 'fix: apply build FLAGS correctly' (#4) from wiesendsi102436/info2Praktikum-DobleSpiel:bugfix/makefile into main
Reviewed-on: freudenreichan/info2Praktikum-DobleSpiel#4
2025-12-15 14:20:07 +00:00
schroederen 1f3fba80ec Merge pull request 'Hinweis hinzugefügt, dass Studis auch für den bintree Unittests schreiben sollen.' (#7) from schroederen/info2Praktikum-DobleSpiel:main into main
Reviewed-on: freudenreichan/info2Praktikum-DobleSpiel#7
2025-12-15 14:17:18 +00:00
schroederen 1d363980f6 Hinweis hinzugefügt, dass Studis auch für den bintree Unittests schreiben sollen. 2025-12-15 15:16:50 +01:00
wiesendsi102436 4ce3a6aac0 fix: apply build FLAGS correctly
A typo in the dependency variable program_obj_files caused make to fall back to implicit/default rules. FLAGS was ignored because the default behavior is to use CFLAGS.
2025-11-30 10:55:37 +01:00
schroederen c325131503 Merge pull request 'Update doble libs.' (#3) from schroederen/info2Praktikum-DobleSpiel:main into main
Reviewed-on: freudenreichan/info2Praktikum-DobleSpiel#3
2025-11-17 12:20:46 +00:00
schroederen 6f7c21e179 Update doble libs.
timer.c ist nun plattformunabhängig.
2025-11-17 13:19:17 +01:00
schroederen 0e13d1035e libdoble_complete.a gelöscht 2025-11-17 10:58:13 +00:00
schroederen f4dd2a5c08 Merge pull request 'Windows lib hinzugefügt.' (#2) from schroederen/info2Praktikum-DobleSpiel:main into main
Reviewed-on: freudenreichan/info2Praktikum-DobleSpiel#2
2025-11-17 10:57:37 +00:00
8 changed files with 34 additions and 2 deletions

No files matched your search

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -29,7 +29,7 @@ program_obj_files = stack.o bintree.o numbers.o timer.o highscore.o
doble : main.o $(program_obj_files)
$(CC) $(FLAGS) $^ -o doble
$(program_obj_filesobj_files): %.o: %.c
$(program_obj_files): %.o: %.c
$(CC) -c $(FLAGS) $^ -o $@
# --------------------------
+33 -1
View File
@@ -1,6 +1,37 @@
#include <time.h>
#include "timer.h"
#if __APPLE__
#include <sys/time.h>
static struct timespec start = {0, 0};
// Starts the timer.
void startTimer()
{
clock_gettime(CLOCK_MONOTONIC, &start);
}
// Returns the time in seconds since startTimer() was called.
double stopTimer()
{
struct timespec end;
clock_gettime(CLOCK_MONOTONIC, &end);
unsigned long long delta_us = (end.tv_sec - start.tv_sec) * 1000000 + (end.tv_nsec - start.tv_nsec) / 1000;
double measuredSeconds = (double)delta_us / 1000000.;
if(start.tv_nsec > 0) {
start.tv_nsec = 0;
start.tv_sec = 0;
}
else
measuredSeconds = -1;
return measuredSeconds;
}
#else
#include <time.h>
static clock_t startClocks = 0;
// Starts the timer.
@@ -21,3 +52,4 @@ double stopTimer()
return measuredSeconds;
}
#endif
Binary file not shown.