diff options
| author | Christian Cunningham <cc@local.lan> | 2025-03-05 12:58:42 -0800 |
|---|---|---|
| committer | Christian Cunningham <cc@local.lan> | 2025-03-05 12:58:42 -0800 |
| commit | 680d8a35ab6cf7b37282f13e8d47756272aee39b (patch) | |
| tree | fb93bbff4613b98f100cd7d01b7166b9d786adbc /src | |
| parent | cafe6c8f3e8694db5d04195b4b559165f202c46e (diff) | |
Timing macro
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -13,6 +13,8 @@ #define OFFSET 16 +#define N_DILATIONS 3 + int main(int argc, char** argv) { //----------------------------------------------- @@ -54,11 +56,14 @@ int main(int argc, char** argv) } printf("%u labels found\n", starting_label-1); printf("Mask dimensions: %u %u\n", width, height); - for (uint16_t count = 0; count < 3; count++) { + TIME(ts_start); + for (uint16_t count = 0; count < N_DILATIONS; count++) { uint16_t *new_labels = dilate(masks, width, height); free(masks); masks = new_labels; } + TIME(ts_end); + printf("Dilation took %f ms\n", 1000*diff_time(&ts_end, &ts_start)); //free(masks); //----------------------------------------------- |
