RealDocs

UKismetMathLibrary::TimespanZeroValue

function Engine Blueprint Since 4.0
#include "Kismet/KismetMathLibrary.h"
Access: public Specifiers: staticBlueprintPure

Description

Returns a zero-duration FTimespan. Equivalent to FTimespan::Zero() and to default-constructing an FTimespan.

Caveats & Gotchas

  • Default-constructed FTimespan() already equals zero, so calling TimespanZeroValue() purely for initialisation is redundant — use it mainly for clarity in Blueprint graphs where the zero literal isn't available.
  • A zero timespan compares equal to FTimespan(0), so it is safe to use as the identity element for duration accumulation.

Signature

static UE_INL_API FTimespan TimespanZeroValue( );

Return Type

FTimespan

Example

Accumulate elapsed time in a loop C++
FTimespan Total = UKismetMathLibrary::TimespanZeroValue();
for (const FTimespan& Segment : Segments)
{
    Total += Segment;
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.