RealDocs

UKismetMathLibrary::FromMilliseconds

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

Description

Constructs an FTimespan from a number of milliseconds. Commonly used when working with network RTT, animation blend times, or any duration naturally expressed in milliseconds.

Caveats & Gotchas

  • FTimespan has 100-nanosecond resolution (10,000 ticks per millisecond), so sub-millisecond fractions are preserved. However, Blueprint float pins are 32-bit, which limits precision to roughly ±16 million milliseconds (~4.5 hours) without accumulated error when used via Blueprint.
  • Passing fractional milliseconds that are not representable in 100 ns increments will be rounded to the nearest tick — this is harmless for most gameplay use but worth knowing for high-precision timing.

Signature

static ENGINE_API FTimespan FromMilliseconds(double Milliseconds );

Parameters

Name Type Description Default
Milliseconds double Number of milliseconds (may be fractional).

Return Type

FTimespan

Example

Convert a ping measurement to a timespan for comparison C++
float PingMs = PlayerState->ExactPing; // already in ms
FTimespan PingSpan = UKismetMathLibrary::FromMilliseconds(PingMs);
bool bHighLatency = PingSpan > UKismetMathLibrary::FromMilliseconds(150.0);

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.