good idea, just added that fix to sokol_time.h
-
-
-
Nice! It adds a bit of overhead, so not recommended for profiling things. Otherwise it should be fine, and definitely required for Xbox One which has a very high res timer.
কথা-বার্তা শেষ
নতুন কথা-বার্তা -
-
-
How do you think this compares to (int)((double) QueryPerformanceCounter / QueryPerformanceFrequency * 1000000 )? Not as accurate, not deterministic?
-
Although this is very accurate initially, as soon as the counter gets larger, accuracy is diminished. Have never used doubles myself though. I would refer tohttps://randomascii.wordpress.com/2012/02/13/dont-store-that-in-a-float/ …
কথা-বার্তা শেষ
নতুন কথা-বার্তা -
-
-
this is only needed when converting elapsed time to integer microseconds right? for deltas something like: double deltaTime = ((double)(currentTicks-previousTicks)*secondsPerTick); should be ok right? (ticks are in native frequency returned by QueryPerformanceCounter)
-
Exactly, deltas are fine. I prefer to use them when possible. If you need elapsed time but don’t care about exact wall clock time, just sum those deltas. Obviously that accumulates error depending on timer resolution.
কথা-বার্তা শেষ
নতুন কথা-বার্তা -
-
-
Better to use _umul128 then __shiftright128.
-
Could you explain please, better in which way?
-
Integer division is very slow, your solution has two of them. To convert from qpc ticks to microseconds you multiply by to/from units as you showed originally. Equivalently to/from = mul / 2^shift which you can execute as a multiply and shift right.
-
Solve for mul = (to << shift) / from, you can squeeze a bit more accuracy by rounding instead of truncating mul = ((to << shift) + from/2) / from. You have an equation with 2 unknowns, but shift only has a few possible values [32,0] so we can brute force.
-
Since QPC freq doesn't change we can cache mul and shift off on startup and use their values to make our actual time calculation fast and accurate.pic.twitter.com/UBK4QeMosb
-
নতুন কথা-বার্তা -
লোড হতে বেশ কিছুক্ষণ সময় নিচ্ছে।
টুইটার তার ক্ষমতার বাইরে চলে গেছে বা কোনো সাময়িক সমস্যার সম্মুখীন হয়েছে আবার চেষ্টা করুন বা আরও তথ্যের জন্য টুইটারের স্থিতি দেখুন।