# TSSetTimeSpan
sets the time span. The solution will be computed and stored for each time requested in the span 
## Synopsis
```
#include "petscts.h"  
PetscErrorCode TSSetTimeSpan(TS ts, PetscInt n, PetscReal *span_times)
```
Collective


## Input Parameters

- ***ts -*** the time-stepper
- ***n -*** number of the time points (>=2)
- ***span_times -*** array of the time points. The first element and the last element are the initial time and the final time respectively.



## Options Database Key

- ***-ts_time_span <t0,...tf> -*** Sets the time span





## Notes
The elements in tspan must be all increasing. They correspond to the intermediate points for time integration.
`TS_EXACTFINALTIME_MATCHSTEP` must be used to make the last time step in each sub-interval match the intermediate points specified.
The intermediate solutions are saved in a vector array that can be accessed with `TSGetTimeSpanSolutions()`. Thus using time span may
pressure the memory system when using a large number of span points.


## See Also
 [](chapter_ts), `TS`, `TSGetTimeSpan()`, `TSGetTimeSpanSolutions()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/interface/ts.c.html#TSSetTimeSpan">src/ts/interface/ts.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ts/interface/ts.c)


[Index of all TS routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
