# tfl.test_utils.TimeTracker

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/lattice/blob/v2.1.1/tensorflow_lattice/python/test_utils.py#L27-L51) |

Tracks time.

    tfl.test_utils.TimeTracker(
        list_to_append, num_steps=1
    )

Keeps track of time spent in its scope and appends it to 'list_to_append'
on exit from scope divided by 'num_steps' if provided.

<br />

<br />

<br />

| ## Example ||
|---|---|
| training_step_times = \[\] with TimeTracker(training_step_times, num_steps=num_epochs): model.fit(... epochs=num_epochs ...) print np.median(training_step_times) ||

<br />

## Methods

### `__enter__`

[View source](https://github.com/tensorflow/lattice/blob/v2.1.1/tensorflow_lattice/python/test_utils.py#L44-L46)

    __enter__()

### `__exit__`

[View source](https://github.com/tensorflow/lattice/blob/v2.1.1/tensorflow_lattice/python/test_utils.py#L48-L51)

    __exit__(
        unuesd_type, unuesd_value, unuesd_traceback
    )