aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorChristian C <cc@localhost>2025-03-05 12:58:42 -0800
committerChristian C <cc@localhost>2025-03-05 12:58:42 -0800
commit3b4f9ae515f421c6f4509cfe9caa4b2415f1adb9 (patch)
treefb93bbff4613b98f100cd7d01b7166b9d786adbc /src/main.c
parent780ec463612e6a7fd61f0bd2ef029836c333922f (diff)
Timing macro
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 02f5520..abfc57f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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);
//-----------------------------------------------