int integer1 = 0;
void setup (void)
void loop (void) // this runs forever
integer1++; // add 1 to "integer1"
delay(1); // delay 1 millisecond
This works (ish) if you don't need the Arduino to do anything else at all apart from increment the number. If you're going to modify the code to do anything else then you will need to use a more sophisticated approach which is demonstrated in the 'blink without delay' sketch. That approach will enable you to increment the number at the right speed regardless of what else the sketch is doing.
As an aside, all you're doing here is counting the passage of time. The Arduino already provides a millis() function which you can call to find how many milliseconds have elapsed since startup. Quite likely what you're trying to achieve could be done by calling millis() when you want to know the value instead of incrementing your own counter, in which case you don't need any code at all.