question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[@gavinking] I think we should have a sleep() function in the language module. This can be implemented in both JS and Java, right?

[Migrated from ceylon/ceylon.language#596]

Issue Analytics

  • State:open
  • Created 9 years ago
  • Reactions:1
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
renatoathaydescommented, Mar 27, 2016

my CPU run’s hot enough already @jvasileff https://xkcd.com/1172/

1reaction
renatoathaydescommented, Mar 27, 2016

It seems to me the appropriate platform-neutral approach to this would have to be to use a callback, so you do not assume the platform you’re running on has Threads or similar:

sleep(1k, function() {
    // after one second, we continue
});

Seems quite reasonable to me. Unless you want to add continuations to the language!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sleep (system call) - Wikipedia
Sleep (system call) ... A computer program (process, task, or thread) may sleep, which places it into an inactive state for a period...
Read more >
system-sleep - npm
A real and better system sleep() for Node. Works on every platform.. Latest version: 1.3.7, last published: 2 years ago.
Read more >
System.Sleep(Integer) Method - Business Central
When you use the Sleep method, control is guaranteed to return to the operating system for at least Duration milliseconds.
Read more >
Pausing Execution with Sleep (The Java™ Tutorials ...
Thread.sleep causes the current thread to suspend execution for a specified period. This is an efficient means of making processor time available to...
Read more >
sleep() Function in C - GeeksforGeeks
sleep() function in C allows the users to wait for a current thread for a specific time. Other operations of the CPU will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found