Question: I'm trying to create a simple doc on google docs, I have a sheet called "Income" 

With A Being name, B being a date, and C being the amount

What I need to do is get the amount for this month, date format is dd/mm/yyyy 

Any help would be appreciated!

Answer: 
Change

```
dif = (end - start) * 1000;

```

to

```
dif = (end.tv_sec - start.tv_sec) * 1000 
+ (end.tv_usec - start.tv_usec) / 1000;

```

In pseudocode:

```
Get the seconds part of the time delta
Multiply by 1000 to get milliseconds
Get the microseconds part of the time delta
Divide that part by 1000
Add that part to the milliseconds from seconds delta

```
On Linux the best way to achieve this is to use the times(2) interface rather than gettimeofday(2) have a read of the man page. 

> 
> man 2 times.
> 
> 
> 

It has exquisite fidelity.