# Print timestamp of running time (not world time)

**URL:** <https://forums.unrealengine.com/t/print-timestamp-of-running-time-not-world-time/118211>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [November 1, 2018, 9:06am UTC](https://forums.unrealengine.com/t/print-timestamp-of-running-time-not-world-time/118211 "2018-11-01T09:06:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lunarix\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lunarix\_1](https://forums.unrealengine.com/u/Lunarix_1)\
**Post date:** [November 1, 2018, 9:06am UTC](https://forums.unrealengine.com/t/print-timestamp-of-running-time-not-world-time/118211/1 "2018-11-01T09:06:34Z")

</div>

Hello 🙂  
I’ve some heavy functions in my code and I’d love to improve its performance. It’s LineTracesSingleByObjectType which is called \>100.000 times a tick.  
Now I’d like to see if my ParallelFor really improves the performance.  
How to print the current timestamp of the code running?  
Also I tried to print some stuff before and after the For-Loop but it always gets printed at the same time, tho the World is moving really slow and the computationtime should be high between.

Hope you can help me out! 🙂  
~L

---

<div class="post-metadata">

**Author:** ![ExtraLifeMatt](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/extralifematt/32/918695_2.png) [@ExtraLifeMatt](https://forums.unrealengine.com/u/ExtraLifeMatt)\
**Post date:** [November 1, 2018, 1:01pm UTC](https://forums.unrealengine.com/t/print-timestamp-of-running-time-not-world-time/118211/2 "2018-11-01T13:01:46Z")

</div>

You can use QUICK\_SCOPE\_CYCLE\_COUNTER and get time values in the UE4 profiler.

> **[CPU Profiling](https://docs.unrealengine.com/4.27/en-US/TestingAndOptimization/PerformanceAndProfiling/CPU/)**
>
> How to optimize the CPU demands of your game.

However, 100K Ray traces is never going to be performant. Even if you Async query them, that’s just a TON of work for PhysX to handle. If this is a meant for realtime, you may want to look at a compute shader or finding a way to better cull out objects before you attempt to fire a ray.

---

<div class="post-metadata">

**Author:** ![Lunarix\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lunarix\_1](https://forums.unrealengine.com/u/Lunarix_1)\
**Post date:** [November 1, 2018, 3:25pm UTC](https://forums.unrealengine.com/t/print-timestamp-of-running-time-not-world-time/118211/3 "2018-11-01T15:25:05Z")

</div>

> [@ExtraLifeMatt](#):
>
> You can use QUICK\_SCOPE\_CYCLE\_COUNTER and get time values in the UE4 profiler.
> 
> [Timing Insights in Unreal Engine 5 | Unreal Engine 5.3 Documentation](https://docs.unrealengine.com/en-US/Engine/Performance/CPU)
> 
> However, 100K Ray traces is never going to be performant. Even if you Async query them, that’s just a TON of work for PhysX to handle. If this is a meant for realtime, you may want to look at a compute shader or finding a way to better cull out objects before you attempt to fire a ray.

I know that it really lacks speed. I’m at ~70k in realtime. My goal would be 5 million… is this somehow possible, of course putting a lot of work in it?

---

<div class="post-metadata">

**Author:** ![ExtraLifeMatt](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/extralifematt/32/918695_2.png) [@ExtraLifeMatt](https://forums.unrealengine.com/u/ExtraLifeMatt)\
**Post date:** [November 1, 2018, 4:44pm UTC](https://forums.unrealengine.com/t/print-timestamp-of-running-time-not-world-time/118211/4 "2018-11-01T16:44:42Z")

</div>

> [@Lunarix](#):
>
> I know that it really lacks speed. I’m at ~70k in realtime. My goal would be 5 million… is this somehow possible, of course putting a lot of work in it?

At 30/60FPS? For a server farm? Sure. For your average PC? Absolutely not. Like I said, you’d have to get clever and devise some compute shader that fakes your ray trace but still gives you the data you want.
