fix: timers on Linux #6

Open
wiesendsi102436 wants to merge 1 commits from wiesendsi102436/info2Praktikum-DobleSpiel:bugfix/timer into main
Contributor

closes #5
On Linux the clock() function measures cpu time instead of wall time. This change uses the Apple code path for Linux.
output with fix:

$ ./doble player2
Wie viele Zahlen sollen gezeigt werden: 3
Numbers:     3     3     2
Welche Zahl kommt doppelt vor: 3
Sie haben die korrekte Zahl in 3.119305 Sekunde(n) gefunden und 2990 Punkte erzielt.
+---------------------------------------------+
|             H I G H S C O R E S             |
+---------------------------------------------+
| player1              |                 3999 |
+---------------------------------------------+
| player2              |                 2990 |
+---------------------------------------------+
closes #5 On Linux the clock() function measures cpu time instead of wall time. This change uses the Apple code path for Linux. output with fix: ``` $ ./doble player2 Wie viele Zahlen sollen gezeigt werden: 3 Numbers: 3 3 2 Welche Zahl kommt doppelt vor: 3 Sie haben die korrekte Zahl in 3.119305 Sekunde(n) gefunden und 2990 Punkte erzielt. +---------------------------------------------+ | H I G H S C O R E S | +---------------------------------------------+ | player1 | 3999 | +---------------------------------------------+ | player2 | 2990 | +---------------------------------------------+ ```
wiesendsi102436 added 1 commit 2025-11-30 10:43:37 +00:00
On Linux the clock() function measures cpu time instead of wall time. This change uses the Apple code path for Linux.
Collaborator

Kann ich leider mangels Linux nicht einfach testen... @freudenreichan kannst du das bei dir bei Gelegenheit mal ausprobieren?

Kann ich leider mangels Linux nicht einfach testen... @freudenreichan kannst du das bei dir bei Gelegenheit mal ausprobieren?
wiesendsi102436 force-pushed bugfix/timer from 4880a9d2f4 to e4db0beda0 2025-12-20 07:57:20 +00:00 Compare
This pull request can be merged automatically.
You are not authorized to merge this pull request.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u bugfix/timer:wiesendsi102436-bugfix/timer
git checkout wiesendsi102436-bugfix/timer
Sign in to join this conversation.
No Reviewers
No Label
No Milestone
No project
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: freudenreichan/info2Praktikum-DobleSpiel#6
No description provided.