sleep-mode

How to restart web workers when computer restarts from sleep mode?

帅比萌擦擦* 提交于 2021-01-29 14:32:26
问题 I have a simple webworker which keeps the current time of timezone using setInterval setInterval(() => { userTimezoneTimestamp = userTimezoneTimestamp + 1000 postMessage(userTimezoneTimestamp); }, 1000); It works fine until I put my machine on sleep mode. When I restart the machine from sleep mode, the time which I get from this worker is older. How can I restart my web worker only when the machine starts up from sleep mode? 回答1: There doesn't seem to be any DOM event letting us know about

Prevent sleep mode python (Wakelock on python)

大城市里の小女人 提交于 2020-05-12 04:44:05
问题 How I can prevent sleep-mode on python without using extra apps on different OS(Ubuntu, Windows...) but in most cases I need Linux solution I am making app that works big amount of time. It uses like 80% of CPU, so a user just start this app and go away from keyboard. So I think I need something like system api or library that lock sleep-mode. I am sure that, it exists. For example, if you open any video player on your OS, your (PC, Laptop) will not go to sleep mode, the same thing in browser

Prevent sleep mode python (Wakelock on python)

我与影子孤独终老i 提交于 2020-05-12 04:40:50
问题 How I can prevent sleep-mode on python without using extra apps on different OS(Ubuntu, Windows...) but in most cases I need Linux solution I am making app that works big amount of time. It uses like 80% of CPU, so a user just start this app and go away from keyboard. So I think I need something like system api or library that lock sleep-mode. I am sure that, it exists. For example, if you open any video player on your OS, your (PC, Laptop) will not go to sleep mode, the same thing in browser

Python Selenium - Adjust pause_time to scroll down in infinite page

走远了吗. 提交于 2020-04-16 03:22:04
问题 I'm trying to scrape all the links available in an infinite page, scrolling down and getting the new links available. However, time.sleep() does not allow to pause the driver for a reasonable time, before scrolling down again and again. Is there any way to adjust the code that you can find at the bottom to reduce the number of sleep during the first iterations (when the page still loads the new content fast) and wait for the necessary time for the next iterations (when the page will load the

Possible to find all Windows processes preventing automatic sleep, w/o admin rights?

不想你离开。 提交于 2020-01-13 04:00:06
问题 The command powercfg -requests will provide a list of processes that are currently preventing a Windows 10 device from automatically entering sleep mode. However, the command requires administrator permissions. Asking for admin access just to perform a simple informational query seems far from ideal. So is it possible to query the Windows 10 API for a similar list, in a user-space application? These processes are passing SetThreadExecutionState() the flags ES_SYSTEM_REQUIRED or ES_DISPLAY

Can I wake up my Android when it is unplugged and sleeping?

左心房为你撑大大i 提交于 2020-01-05 01:34:27
问题 I have made an app that allows one to listen to the radio and have implemented an alarm so that I can have the radio play when the alarm goes off. I am using the alarmManager and RTC_wakeup, and it seems to work fine if the phone is plugged in or if the phone is not asleep (which kind of defeats the purpose). When the phone is unplugged and asleep, however, the alarm does not go off until I wake up the phone. Does anyone know a solution to this? 回答1: This is how we did it and it works in both

How to wake esp8266 from deep sleep without continuous resets

时光总嘲笑我的痴心妄想 提交于 2019-12-31 10:57:11
问题 I'm building an IR to wifi bridge using an esp8266. Basically I'm building an IR receiver connected to an esp8266 inside an IR remote control, to forward received IR Remote keypresses over wifi to a server. I'm using a Wemos D1 Mini. I already have the IR decoding and network forwarding part working, but it is always on, which uses a lot of battery, especially considering that 99% of the time no buttons are being pressed. I want it to go into deep sleep when a button hasn't been pressed for a

How to wake esp8266 from deep sleep without continuous resets

妖精的绣舞 提交于 2019-12-31 10:55:51
问题 I'm building an IR to wifi bridge using an esp8266. Basically I'm building an IR receiver connected to an esp8266 inside an IR remote control, to forward received IR Remote keypresses over wifi to a server. I'm using a Wemos D1 Mini. I already have the IR decoding and network forwarding part working, but it is always on, which uses a lot of battery, especially considering that 99% of the time no buttons are being pressed. I want it to go into deep sleep when a button hasn't been pressed for a

How to use signalr in android Service

江枫思渺然 提交于 2019-12-31 03:32:09
问题 I used the signalr library and the problem that is created for me is that when the phone goes to sleep it will issue a connection time out error and will no longer connect to the server. in Activity public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); startService(new Intent(getApplicationContext(), signalRService.class)); }} in Service public class SignalRService extends Service { private

How to READ the auto sleep time of pc from powercfg.exe (batch) [closed]

不问归期 提交于 2019-12-13 22:27:14
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . I have a batch file that automatically sets the computer to sleep after 0 minutes (aka never sleep). Then I want to set it back to what it was before. My question is how would I set the current sleep time to a variable before I turn it off? Thanks in advance! CLARIFICATION: I'm