22-timed-sorting-2/stopwatch.c
2025-05-07 16:41:09 +02:00

27 lines
872 B
C

/*-----------------------------------------------------------------------------
* HTBLA-Leonding / Class: 2IHIF
*-----------------------------------------------------------------------------
* Exercise Number: S05
* Title: Stopwatch
* Author: Marc Tismonar
*-----------------------------------------------------------------------------
* Description:
* Implementation of a simple stopwatch
*-----------------------------------------------------------------------------
*/
#include <time.h>
#include <stdbool.h>
#include "stopwatch.h"
/**
* Implementation hints:
*
* time functions:
* are provided by `time.h`
* use function `clock()` to get the current `ticks`
* `ticks` are of type `clock_t`
* use `CLOCKS_PER_SEC` to calculate the time in seconds from ticks
* -> seconds = ticks / CLOCK_PER_SEC
* microseconds are s * 10^-6
*/