timeBased

fun timeBased(listener: LeakListener, timeSource: TimeSource, leakThreshold: Duration): LeakDetector

Create a time-based LeakDetector which reports leaks to listener if watched references have not been garbage collected before the leakThreshold.

This function may return None if the platform does not support weak references, in which case listener will never be invoked.