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: 
You want:

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

```

Note 1: You need the tv\_sec to handle even a short duration crossing a second ticking over.

Note 2: Second term divides by a 1000.0 so as to use floating point rather than integer division.
For quick benchmark, I'd use `clock()` and `CLOCKS_PER_SEC`.

Here's some macro code I use:

```
#define CLOCK_TICK(acc, ctr)  ctr = std::clock()
#define CLOCK_TOCK(acc, ctr)  acc += (std::clock() - ctr)
#define CLOCK_RESET(acc) acc = 0
#define CLOCK_REPORT(acc) (1000. * double(acc) / double(CLOCKS_PER_SEC))

static clock_t t1a, t1c;

int main()
{
   while (true)
   {
     CLOCK_RESET(t1a);
     init_stuff();
     CLOCK_TICK(t1a, t1c);
     critical_function();
     CLOCK_TOCK(t1a, t1c);

     std::cout << "This round took " << CLOCK_REPORT(t1a) << "ms.\n";
   }
}

```

You can get a higher-resolution clock out of the new `<chrono>` header. The macros should be straight-forward to adapt.