From f34b31acbf13536a1ca487904e40a10f3ca0d2b8 Mon Sep 17 00:00:00 2001 From: Passthem <514827965@qq.com> Date: Fri, 11 Apr 2025 16:05:37 +0800 Subject: [PATCH] move begin time --- src/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index 4fd5aba..a9cba37 100644 --- a/src/main.c +++ b/src/main.c @@ -19,6 +19,9 @@ void handle_sigint(int sig) { int main() { signal(SIGINT, handle_sigint); + struct timeval start_time; + gettimeofday(&start_time, NULL); + const char* device = "/dev/spidev1.0"; const uint8_t spi_mode = SPI_MODE_0; const uint8_t spi_bits = 8; @@ -34,9 +37,6 @@ int main() { uint8_t* buffer = malloc(data_size); Color* colors = malloc(sizeof(Color) * num_leds); - struct timeval start_time; - gettimeofday(&start_time, NULL); - while (!stop) { struct timeval current_time; gettimeofday(¤t_time, NULL);