digitalmars.D.learn - Where is sleep()?
- Ryan David Sheasby (8/8) Dec 17 2017 Hey guys. First time poster here. I've searched high and low but
- rikki cattermole (3/11) Dec 17 2017 That link is not relevant to D.
- Ryan David Sheasby (5/16) Dec 17 2017 Crap sorry you're right. I pasted the wrong link. This is the one
- codephantom (13/21) Dec 17 2017 // --------------
- Adam D. Ruppe (6/7) Dec 17 2017 the official search is hard to use, so I made my own. When
- Steven Schveighoffer (9/19) Dec 17 2017 I searched for "sleep" in "library", core.thread was the first result.
- Adam D. Ruppe (26/28) Dec 17 2017 Yeah, me too (followed by core.time, std.datetime.stopwatch, and
- =?UTF-8?Q?Ali_=c3=87ehreli?= (5/8) Dec 17 2017 Prepending "dlang" to Google searches has been working well for me.
Hey guys. First time poster here. I've searched high and low but can't seem to find a simple sleep/delay/wait/pause function in the core or in phobos. The most recent information I can find about it is this forum post from 12 years ago: http://forum.dlang.org/thread/avr99b$b8j$2 digitaldaemon.com In which they suggest using std.c.time which is now depreciated and seems to have been replaced by core.stdc.time which doesn't have any sleep functions... What am I missing?
Dec 17 2017
On 17/12/2017 8:32 AM, Ryan David Sheasby wrote:Hey guys. First time poster here. I've searched high and low but can't seem to find a simple sleep/delay/wait/pause function in the core or in phobos. The most recent information I can find about it is this forum post from 12 years ago: http://forum.dlang.org/thread/avr99b$b8j$2 digitaldaemon.com In which they suggest using std.c.time which is now depreciated and seems to have been replaced by core.stdc.time which doesn't have any sleep functions... What am I missing?That link is not relevant to D. https://dlang.org/phobos/core_thread.html#.Thread.sleep
Dec 17 2017
On Sunday, 17 December 2017 at 08:40:53 UTC, rikki cattermole wrote:On 17/12/2017 8:32 AM, Ryan David Sheasby wrote:Crap sorry you're right. I pasted the wrong link. This is the one I was talking about: http://forum.dlang.org/thread/diuepu$2ebg$1 digitaldaemon.comHey guys. First time poster here. I've searched high and low but can't seem to find a simple sleep/delay/wait/pause function in the core or in phobos. The most recent information I can find about it is this forum post from 12 years ago: http://forum.dlang.org/thread/avr99b$b8j$2 digitaldaemon.com In which they suggest using std.c.time which is now depreciated and seems to have been replaced by core.stdc.time which doesn't have any sleep functions... What am I missing?That link is not relevant to D. https://dlang.org/phobos/core_thread.html#.Thread.sleep
Dec 17 2017
On Sunday, 17 December 2017 at 08:32:20 UTC, Ryan David Sheasby wrote:Hey guys. First time poster here. I've searched high and low but can't seem to find a simple sleep/delay/wait/pause function in the core or in phobos. The most recent information I can find about it is this forum post from 12 years ago: http://forum.dlang.org/thread/avr99b$b8j$2 digitaldaemon.com In which they suggest using std.c.time which is now depreciated and seems to have been replaced by core.stdc.time which doesn't have any sleep functions... What am I missing?// -------------- import std.stdio; import core.thread; void main() { int waitTime = 5; writeln("Waiting ", waitTime, " seconds..."); Thread.sleep(waitTime.seconds); writeln("Done waiting!"); } // --------------
Dec 17 2017
On Sunday, 17 December 2017 at 08:32:20 UTC, Ryan David Sheasby wrote:What am I missing?the official search is hard to use, so I made my own. When looking for something, try dpldocs.info/search_term http://dpldocs.info/sleep and here it pops right up.
Dec 17 2017
On 12/17/17 8:32 AM, Adam D. Ruppe wrote:On Sunday, 17 December 2017 at 08:32:20 UTC, Ryan David Sheasby wrote:I searched for "sleep" in "library", core.thread was the first result. Now, it would be good to have it link directly to the sleep function itself, but it looks like searching in the library only links to the one-page-per-module version of the docs. If I change google's terms to site:dlang.org/library instead of site:dlang.org/phobos, then searching for sleep gives me the Thread.sleep function as the first result. -SteveWhat am I missing?the official search is hard to use, so I made my own. When looking for something, try dpldocs.info/search_term http://dpldocs.info/sleep and here it pops right up.
Dec 17 2017
On Sunday, 17 December 2017 at 17:01:37 UTC, Steven Schveighoffer wrote:I searched for "sleep" in "library", core.thread was the first result.Yeah, me too (followed by core.time, std.datetime.stopwatch, and std.datetime...), but it isn't obvious any of them are actual winners. If you already basically know what you're looking for, it can refresh, but if it is first time core.thread - D Programming Language https://dlang.org/phobos/core_thread.html Jump to: getAll · getThis · id · isDaemon · isRunning · join · name · opApply · priority · PRIORITY_DEFAULT · PRIORITY_MAX · PRIORITY_MIN · sleep · start · this · yield. class Thread ;. This class encapsulates all threading functionality for the D programming language. As thread manipulation is a required facility for garbage ... doesn't really indicate it was a good hit and when the click the page, even finding that jumplist takes a second search. This is one of the better results I tend to get off the official site. Whereas mine gives: http://dpldocs.info/sleep core.thread.Thread.sleep Suspends the calling thread for at least the supplied period. This may result in multiple OS calls if period is greater than the maximum sleep duration supported by the operating system. immediately, right there on the result page. As well as other hits such as vibe.d's sleep.
Dec 17 2017
On 12/17/2017 12:32 AM, Ryan David Sheasby wrote:I've searched high and low but can't seem to find a simple sleep/delay/wait/pause function in the core or in phobos.Prepending "dlang" to Google searches has been working well for me. Googling for "dlang sleep" lists the documentation as the first hit for me. Same with "dlang phobos sleep", "dlang druntime sleep", etc. Ali
Dec 17 2017