Try this :
int voltage;
int table[200];
unsigned long timee[200];
int n;
bool finish;
unsigned long ttimee;
void setup()
{
pinMode(9, OUTPUT);
pinMode(3, OUTPUT);
pinMode(5, OUTPUT);
digitalWrite(5, HIGH);
Serial.begin(115200);
digitalWrite(3, 0);
analogWrite(9, 90);
n = 0;
finish = 0;
ttimee = 0;
}
void loop()
{
unsigned long currentTime = micros(); //only read micros() once
if (n < 200)
{
if (currentTime - ttimee >= 1000)
{
voltage = analogRead(A0);
table[n] = voltage;
timee[n] = currentTime / 1000;
n++;
ttimee = currentTime;
}
}
else if (!finish)
{
finish = true;
analogWrite(9, 0);
for (n = 0; n < 200; n++)
{
Serial.print(timee[n]);
Serial.print("\t");
Serial.println(table[n]);
}
}
}
Note the use of micros() instead of millis() and the fact that the current time is only read once then used elsewhere in the program