I'm trying to divide a timeval
by an integer. Here's what I've got so far:
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
int
main(void)
{
struct timeval my_time;
struct timeval my_time_quotient;
int i;
gettimeofday(&my_time, NULL);
i = 5;
my_time_quotient = my_time / i;
printf("%d secs, %d msecs\n", (int)my_time_quotient.tv_sec, (int)my_time_quotient.tv_usec);
return 0;
}
When I compile I get:
jen@ubuntu:~/$ gcc -g -otimespike timespike.c
timespike.c: In function ‘main’:
timespike.c:15: error: invalid operands to binary / (have ‘struct timeval’ and ‘int’)
What's the correct way to find the quotient?