duration

Contents

duration#

pypulseqpp.sequences.duration()[source]#

Return the time a sequence, or a chain of sequences, plays, in seconds.

Parameters:

result (pypulseqpp.Sequence or list of pypulseqpp.Sequence) – What a sequence function returns.

Returns:

The sum of the total durations pypulseqpp.Sequence.duration() reports for the sequences.

Return type:

float

Examples

>>> import pypulseqpp as pp
>>> from pypulseqpp import sequences
>>> def one_delay(seconds):
...     seq = pp.Sequence(pp.Opts())
...     seq.add_block(pp.make_delay(seconds))
...     return seq
>>> round(sequences.duration([one_delay(1e-3), one_delay(2e-3)]), 9)
0.003