Is there a way to do that?
I want to make a web request quite frequently, and at least for development purposes, and would like to see changes fast. If I don't have to click on `Simulation > Background Events > [Enter]` every time I change the mc code, I would be one happy programmer.
Something like this:
```
function initialize() {
AppBase.initialize();
// perform a background event immediately on startup
Background.registerForTemporalEvent(Time.now());
// then every 5 minutes
Background.registerForTemporalEvent(new Time.Duration(5 * 60));
}
```
Currently that fails at the first registration in the simulator:
```
Error: Unhandled Exception
Exception: Background time cannot be set less than 5 minutes since the last run
```
> For watch-apps and widgets the 5 minute restriction is cleared on application startup if the event was specified using a Moment.
https://developer.garmin.com/connect-iq/api-docs/Toybox/Background.html#registerForTemporalEvent-instance_function
`Time.now()` is a moment. Is there something I'm missing? I tried commenting out the duration time, waiting an hour, adding 1 second, subtracting one second, resetting the simulator. The only case that didn't error is if I used a `if (Background.getTemporalEventRegisteredTime() == null)` guard, maybe it's something about the app being instantiated in multiple places, there's still a few options to look at, but they don't solve the overall issue.
Because the next line in the docs says only one time may be registered at a time, so the second registration would override the first.
Once I figure out why I'm getting an error with a Moment (maybe it is a simulator bug related to the footnote of https://developer.garmin.com/connect-iq/connect-iq-faq/how-do-i-create-a-connect-iq-background-service/#howdoicreateaconnectiqbackgroundservice?), I'll try to register by moment, and after I get the first slice of data back, register by duration.
What kind of patterns do you use for this? Any tricks you could share?