android-components / mozilla.components.browser.session.storage / AutoSave / periodicallyInForeground

# periodicallyInForeground

`fun periodicallyInForeground(interval: Long = 300, unit: TimeUnit = TimeUnit.SECONDS, scheduler: ScheduledExecutorService = Executors.newSingleThreadScheduledExecutor(), lifecycle: Lifecycle = ProcessLifecycleOwner.get().lifecycle): AutoSave` (source)

Saves the state periodically when the app is in the foreground.

### Parameters

`interval` - The interval in which the state should be saved to disk.

`unit` - The time unit of the interval parameter.