In your resetTime function you are using the "+=" operator, which adds onto the variable's current value, rather than assigning it directly to the specified value. See this example to understand the difference between += and = operators:
int x = 1 //declaring int, initial value is 1
x += 5 // this evaluates to "x = x + 5", so x's value is now 6
x = 999 // this evaluates to "x = 999", setting x's value directly to 999
In the resetTime() method you are adding 0 to the current value of time, not setting time to 0. Change that line to use the = operator instead of the += operator and you should get the desired behavior.