RealDocs

UKismetMathLibrary::LessEqual_TimespanTimespan

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

Description

Returns true if A is less than or equal to B. Equivalent to !Greater_TimespanTimespan(A, B).

Caveats & Gotchas

  • Like all Timespan comparisons, equality is exact tick-level — be cautious comparing timespans derived from float arithmetic.
  • In C++ use the <= operator on FTimespan directly; this function is the Blueprint wrapper.

Signature

static UE_INL_API bool LessEqual_TimespanTimespan( FTimespan A, FTimespan B );

Parameters

Name Type Description Default
A FTimespan Left-hand timespan.
B FTimespan Right-hand timespan.

Return Type

bool

Example

Check if a process finished within a deadline C++
FTimespan Deadline = FTimespan::FromSeconds(60.0);
if (UKismetMathLibrary::LessEqual_TimespanTimespan(ProcessTime, Deadline))
{
    GEngine->AddOnScreenDebugMessage(-1, 3.f, FColor::Green, TEXT("Finished in time!"));
}

Version History

Introduced in: 4.7

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.