The error is exactly what it says it is. Until you initialize a variable, its contents are unknown. So you must not try to "read" from it until you set it to something meaningful.
Bad (what you're doing):
1 2 3 4
int time; // <- time is not initialized
time++; // increments time... but it's not initialized, so incrementing it makes
// no sense!
Good (what you should be doing):
1 2 3
int time = 0; // initialize it. Now you know time==0
time++; // increments it. Now it's meaningful because we know time now == 1