# timer {#timer}

**Parent topic:**[Programming Statements](../../Programming/ProgrammingStatements/programming_statements.md)

## Syntax {#syntax}

```
timer{ 
   <statement block>; 
}
```

or

```
timer (X){ 
    <statement block>;
}
```

## Arguments {#arguments}

For the second scenario, X is a positive integer indicating the number of times to execute the specified statement block consecutively \(not in parallel\).

## Details {#details}

Return the execution time of the specified statements.

## Examples {#examples}

```
x=rand(10.0, 1000000);

timer x*2;
// Time elapsed: 3 ms

timer(10){x*2};
// Time elapsed: 35.004 ms
```

