"""At most three opt-in class timing snapshots; no global profiler, coordinates or I/O."""

import time


def profile_update(tracker, observations):
    classes = []
    wall, cpu = time.monotonic_ns(), time.thread_time_ns()
    result = tracker._update(observations, class_samples=classes)
    return result, dict(wall_ms=(time.monotonic_ns()-wall)/1e6,
                        thread_cpu_ms=(time.thread_time_ns()-cpu)/1e6,
                        classes=classes, instrumented=True)
