Re: How to find the right function in the Phobos library?

2024-08-18 Thread Ron Tarrant via Digitalmars-d-learn
On Saturday, 17 August 2024 at 17:31:53 UTC, Steven Schveighoffer wrote: Go to dlang.org, select dicumentation, then library reference. Pick any module, click on it In the upper right, switch the docs from stable to ddox Now you can use the search bar and it is interactive. Typing in indexOf

Re: How to find the right function in the Phobos library?

2024-08-18 Thread Vinod K Chandran via Digitalmars-d-learn
On Sunday, 18 August 2024 at 08:39:49 UTC, IchorDev wrote: As Rikki points out, delay or sleep functions (as the name says) ‘put the thread to sleep’. If you want the thread to be constantly busy, you can use a while loop: ```d import core.time; //waste electricity for 1ms: const endTime = M

Re: How to find the right function in the Phobos library?

2024-08-18 Thread Vinod K Chandran via Digitalmars-d-learn
On Saturday, 17 August 2024 at 19:54:07 UTC, Richard (Rikki) Andrew Cattermole wrote: https://dlang.org/phobos/core_thread_osthread.html#.Thread.sleep Worth noting is that sleeping is not equivalent to performing work. It's the exact opposite, the lack of work. Thanks Rikki. Actually, I wa

Re: How to find the right function in the Phobos library?

2024-08-18 Thread IchorDev via Digitalmars-d-learn
On Saturday, 17 August 2024 at 19:49:04 UTC, Vinod K Chandran wrote: All I want is a delay function which simulate some work load in current thread. As Rikki points out, delay or sleep functions (as the name says) ‘put the thread to sleep’. If you want the thread to be constantly busy, you ca