move begin time

This commit is contained in:
Passthem
2025-04-11 16:05:37 +08:00
parent 9878c81d59
commit f34b31acbf

View File

@ -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(&current_time, NULL);