then you can call the static method FApp::GetDeltaTime(); from within your worker function to get the deltatime as a double (can be cast to a float if you want it to mirror the ingame dt format).
older suggestion:
Have you considered passing in the game deltatime in the worker manager actor tick?
where AMyClass would be the manager class and Worker is the FRunnable inherited class
void AMyClass::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
if (Worker)
{
Worker->DeltaTime = DeltaTime; // passing in the delta time from game thread
UE_LOG(LogTemp, Warning, TEXT("Game thread: deltaTime gotten from worker thread: %f"), Worker->DeltaTime) // retrieving the delta time from the frunnable and printing it
}
}
Thank you for your help.
However I don’t think it’s possible to safely obtain DeltaTime within the thread using this method. I want to calculate DeltaTime using the thread independent of the game thread.