Repository: pytorch/ignite

Issue:
Improve the example of Timer's usage
## 📚 Documentation

The example in the `Timer's documentation suggest to estimate the processing time for a batch as follows:
```python
timer.attach(
    trainer, 
    start=Events.EPOCH_STARTED, 
    resume=Events.ITERATION_STARTED, 
    pause=Events.ITERATION_COMPLETED, 
    step=Events.ITERATION_COMPLETED)
```
It is to note that this timer will be reset at the start of each epoch. When we use multiple workers in the data loader, the first couple of iterations at each epoch often take longer than the later ones. The reset behavior will incur an inaccurate estimation of the remaining training time (ETA), even when the `average` flag is set to `True`. Specifically, the ETA is computed as `(engine.state.max_iters - engine.state.iteration) * time_per_iter`. So the small fluctuation in `time_per_iter` will be magnified by remaining number of iterations. To address this problem, we can let the timer only start once in the whole training process:
```python
 timer.attach(
    trainer, 
    start=Events.EPOCH_STARTED(once=1), 
    resume=Events.ITERATION_STARTED, 
    pause=Events.ITERATION_COMPLETED, 
    step=Events.ITERATION_COMPLETED)
```
I have empirically verified the effectiveness of this modification.


Discussion:
Thanks for reporting @sandylaker !
I haven't yet checked the results, but I wonder how inaccurate the results are. Could you please give an example of current behavior vs expected. 
Another question why can't we use Events.STARTED instead ?

@Priyansi what do you think?
@vfdev-5 Here is an example log of experiment.
```shell
2021-08-20 09:40:56,046 ignite INFO: Epoch [2/100] [36/164]: batch time: 1.18941; eta: 5:55:59; lr: 2.505e-05; train loss: 1.18874
2021-08-20 09:41:58,296 ignite INFO: Epoch [2/100] [86/164]: batch time: 1.12603; eta: 5:37:56; lr: 3.110e-05; train loss: 1.03650
2021-08-20 09:44:09,551 ignite INFO: Epoch [2/100] [136/164]: batch time: 1.04319; eta: 5:14:46; lr: 3.714e-05; train loss: 1.13485
2021-08-20 09:45:29,774 ignite INFO: Epoch [2/100]: validation epoch time: 0:00:31; val_loss: 1.01249; accuracy: 0.81528; precision: 0.71423; recall: 0.53101
2021-08-20 09:46:22,633 ignite INFO: Epoch [3/100] [22/164]: batch time: 1.87278; eta: 9:12:34; lr: 4.319e-05; train loss: 0.91799
2021-08-20 09:48:04,309 ignite INFO: Epoch [3/100] [72/164]: batch time: 1.52747; eta: 7:38:56; lr: 4.923e-05; train loss: 1.29370
2021-08-20 09:50:34,198 ignite INFO: Epoch [3/100] [122/164]: batch time: 1.58451; eta: 7:52:49; lr: 5.527e-05; train loss: 1.21339
```
We can see that the estimated batch time drops in each epoch as the iteration number increases. This is because I use 8 workers. We also see that the ETA in the first log message in the 3rd epoch is longer than the previous ones. This is due to the fact that the timer is reset, and unfortunately the first couple of batches in epoch 3 take longer. We hope the ETA keeps decreasing as the training goes on. In order to do this, we can increase the number of batch time records to provide more accurate estimation, e.g. only reset the timer for once.
Thanks @sandylaker , make sense.
Can you please check if using Events.STARTED would work ?
@vfdev-5 It also works. Please see the following log:
```shell
[0]<stderr>:2021-08-21 23:33:50,758 ignite INFO: Epoch [1/100] [10/50]: batch time: 3.13489; eta: 4:20:43; lr: 4.578e-06; train loss: 2.40777
[0]<stderr>:2021-08-21 23:34:16,061 ignite INFO: Epoch [1/100] [20/50]: batch time: 2.76993; eta: 3:49:54; lr: 8.554e-06; train loss: 2.15799
[0]<stderr>:2021-08-21 23:34:45,482 ignite INFO: Epoch [1/100] [30/50]: batch time: 2.34365; eta: 3:14:07; lr: 1.253e-05; train loss: 2.26927
[0]<stderr>:2021-08-21 23:35:11,477 ignite INFO: Epoch [1/100] [40/50]: batch time: 2.39976; eta: 3:18:22; lr: 1.651e-05; train loss: 2.03384
[0]<stderr>:2021-08-21 23:35:25,625 ignite INFO: Epoch [1/100] [0/50]: batch time: 2.10667; eta: 2:53:48; lr: 2.048e-05; train loss: 1.02629
[0]<stderr>:2021-08-21 23:35:57,737 ignite INFO: Epoch [1/100]: validation epoch time: 0:00:31; val_loss: 1.90737; accuracy: 0.43252; precision: 0.11525; recall: 0.[0]<stderr>:
[0]<stderr>:2021-08-21 23:36:26,375 ignite INFO: Epoch [2/100] [10/50]: batch time: 2.08878; eta: 2:51:58; lr: 2.446e-05; train loss: 1.73261
[0]<stderr>:2021-08-21 23:36:46,239 ignite INFO: Epoch [2/100] [20/50]: batch time: 1.94054; eta: 2:39:26; lr: 2.843e-05; train loss: 1.80995
[0]<stderr>:2021-08-21 23:37:06,633 ignite INFO: Epoch [2/100] [30/50]: batch time: 1.79434; eta: 2:27:08; lr: 3.241e-05; train loss: 1.76788
```
@sandylaker thanks ! Would you like to send a PR with a fix ?

Resolving patch:
diff --git a/ignite/handlers/timing.py b/ignite/handlers/timing.py
--- a/ignite/handlers/timing.py
+++ b/ignite/handlers/timing.py
@@ -70,7 +70,7 @@ class Timer:
         >>> trainer = Engine(training_update_function)
         >>> timer = Timer(average=True)
         >>> timer.attach(trainer,
-        ...              start=Events.EPOCH_STARTED,
+        ...              start=Events.STARTED,
         ...              resume=Events.ITERATION_STARTED,
         ...              pause=Events.ITERATION_COMPLETED,
         ...              step=Events.ITERATION_COMPLETED)


Test patch: