Re: High-resolution thread sleep

2017-12-15 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/15/17 5:43 AM, Rene Zwanenburg wrote: On Friday, 15 December 2017 at 01:49:56 UTC, Steven Schveighoffer wrote: So... you plan on rendering more than 1000 frames per second? I think in any case, even if the API allows it, you are probably not getting much better resolution on your non-wi

Re: High-resolution thread sleep

2017-12-15 Thread Rene Zwanenburg via Digitalmars-d-learn
On Friday, 15 December 2017 at 01:49:56 UTC, Steven Schveighoffer wrote: So... you plan on rendering more than 1000 frames per second? I think in any case, even if the API allows it, you are probably not getting much better resolution on your non-windows systems. Have you tried it anyway an

Re: High-resolution thread sleep

2017-12-14 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/14/17 6:45 PM, Ivan Trombley wrote: On Thursday, 14 December 2017 at 21:47:05 UTC, Rene Zwanenburg wrote: On Thursday, 14 December 2017 at 21:11:34 UTC, Ivan Trombley wrote: I need to be able to put a thread to sleep for some amount of time. I was looking at using Thread.sleep but it appe

Re: High-resolution thread sleep

2017-12-14 Thread Ivan Trombley via Digitalmars-d-learn
On Friday, 15 December 2017 at 00:39:13 UTC, Rene Zwanenburg wrote: On Thursday, 14 December 2017 at 23:45:18 UTC, Ivan Trombley wrote: Something along the lines of this: while (render) { immutable auto startTime = MonoTime.currTime; // Render the frame... immutable auto remain = m_fram

Re: High-resolution thread sleep

2017-12-14 Thread Rene Zwanenburg via Digitalmars-d-learn
On Thursday, 14 December 2017 at 23:45:18 UTC, Ivan Trombley wrote: Something along the lines of this: while (render) { immutable auto startTime = MonoTime.currTime; // Render the frame... immutable auto remain = m_frameDuration - (startTime - MonoTime.currTime); if (remain > Duratio

Re: High-resolution thread sleep

2017-12-14 Thread Ivan Trombley via Digitalmars-d-learn
On Thursday, 14 December 2017 at 21:47:05 UTC, Rene Zwanenburg wrote: On Thursday, 14 December 2017 at 21:11:34 UTC, Ivan Trombley wrote: I need to be able to put a thread to sleep for some amount of time. I was looking at using Thread.sleep but it appears that on Windows, it's limited to milli

Re: High-resolution thread sleep

2017-12-14 Thread Rene Zwanenburg via Digitalmars-d-learn
On Thursday, 14 December 2017 at 21:11:34 UTC, Ivan Trombley wrote: I need to be able to put a thread to sleep for some amount of time. I was looking at using Thread.sleep but it appears that on Windows, it's limited to millisecond resolution. Is there a way to do this in a cross-platform way t

High-resolution thread sleep

2017-12-14 Thread Ivan Trombley via Digitalmars-d-learn
I need to be able to put a thread to sleep for some amount of time. I was looking at using Thread.sleep but it appears that on Windows, it's limited to millisecond resolution. Is there a way to do this in a cross-platform way that is higher resolution?