def run(self):

        next_sample_time_seconds = self.time_fxn()
        sample_number = 0

        # Keep sampling until this thread is explicitly stopped.
        while not self.should_stop():
            # Take a sample of the main request thread's frame stack...
            self.profile.take_sample(sample_number)
            sample_number += 1

            # ...then sleep and let it do some more work.
            next_sample_time_seconds += (
                1.0 / InspectingThread.SAMPLES_PER_SECOND)
            seconds_to_sleep = (
                next_sample_time_seconds - self.time_fxn())
            if seconds_to_sleep > 0:
                time.sleep(seconds_to_sleep)

        # Always take a sample at the end.
        self.profile.take_sample(sample_number, force_memory=True)
Start periodic profiler inspections.
dataset/ETHPy150Open gae-init/gae-init-debug/main/libx/gae_mini_profiler/sampling_profiler.py/InspectingThread.run