Example #1
0
int32 UKismetMathLibrary::GetSecond( FDateTime A )
{
	return A.GetSecond();
}
Example #2
0
FTimeDate ATimeManager::ConvertToTimeDate(FDateTime dt)
{
    return FTimeDate(dt.GetYear(), dt.GetMonth(), dt.GetDay(), dt.GetHour(), dt.GetMinute(), dt.GetSecond(), dt.GetMillisecond());
}
void CaptureEditorData(EditorPerfCaptureParameters& OutEditorPerfStats)
{
	//Capture the current time stamp and format it to YYYY-MM-DD HH:MM:SS.mmm.
	FDateTime CurrentDateAndTime = FDateTime::UtcNow();
	
	//Find the Average FPS
	//Clamp to avoid huge averages at startup or after hitches
	const float CurrentFPS = 1.0f / FSlateApplication::Get().GetAverageDeltaTime();
	const float ClampedFPS = (CurrentFPS < 0.0f || CurrentFPS > 4000.0f) ? 0.0f : CurrentFPS;
	OutEditorPerfStats.AverageFPS.Add(ClampedFPS);

	//Find the Frame Time in ms.
	//Clamp to avoid huge averages at startup or after hitches
	const float AverageMS = FSlateApplication::Get().GetAverageDeltaTime() * 1000.0f;
	const float ClampedMS = (AverageMS < 0.0f || AverageMS > 4000.0f) ? 0.0f : AverageMS;
	OutEditorPerfStats.AverageFrameTime.Add(ClampedMS);

	//Query OS for process memory used.
	FPlatformMemoryStats MemoryStats = FPlatformMemory::GetStats();
	OutEditorPerfStats.UsedPhysical.Add((float)MemoryStats.UsedPhysical / 1024);

	//Query OS for available physical memory
	OutEditorPerfStats.AvailablePhysical.Add((float)MemoryStats.AvailablePhysical / 1024);

	//Query OS for available virtual memory
	OutEditorPerfStats.AvailableVirtual.Add((float)MemoryStats.AvailableVirtual / 1024);

	//Query OS for used virtual memory
	OutEditorPerfStats.UsedVirtual.Add((float)MemoryStats.UsedVirtual / 1024);

	//Query OS for used Peak Used physical memory
	OutEditorPerfStats.PeakUsedPhysical.Add((float)MemoryStats.PeakUsedPhysical / 1024);

	//Query OS for used Peak Used virtual memory
	OutEditorPerfStats.PeakUsedVirtual.Add((float)MemoryStats.PeakUsedVirtual / 1024);

	//Capture the time stamp.
	FString FormatedTimeStamp = FString::Printf(TEXT("%04i-%02i-%02i %02i:%02i:%02i.%03i"), CurrentDateAndTime.GetYear(), CurrentDateAndTime.GetMonth(), CurrentDateAndTime.GetDay(), CurrentDateAndTime.GetHour(), CurrentDateAndTime.GetMinute(), CurrentDateAndTime.GetSecond(), CurrentDateAndTime.GetMillisecond());
	OutEditorPerfStats.FormattedTimeStamp.Add(FormatedTimeStamp);
	OutEditorPerfStats.TimeStamp.Add(CurrentDateAndTime);

}