New to Arduino. Stuck with timing

Hi all,

I'm using Arduino for a project in working on for school. I am not too familiar with coding in Arduino. My question is how would I input code to record for 10 seconds only. I'm using an example code for a barometric sensor that measures temperature, pressure, and altitude. The code includes uses the delay function. Is there a way I can make the code run for 10 seconds only. Because the serial monitor continuously runs.


Read up on the use of millis()

post the code ! tip: whatever happens in loop() keeps happening, whatever happens in setup() happens only once, this modified ‘blink’ example should clarify it

void setup() {
  pinMode(13, OUTPUT);
  for (int count=0; count<10; count++) {
    digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
    delay(1000);              // wait for a second
    digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
    delay(1000);              // wait for a second

void loop() {

how would I input code to record for 10 seconds only

Some useful links Using millis() for timing. A beginners guide, Several things at the same time and look at the BlinkWithoutDelay example in the IDE.