mlco2 / codecarbon

Track emissions from Compute and recommend ways to reduce their impact on the environment.
https://mlco2.github.io/codecarbon
MIT License
1k stars 157 forks source link

Update emissions_tracker.py to fix issue #549 #570

Closed LeahChercham closed 1 week ago

LeahChercham commented 2 weeks ago

Update emissions_tracker.py to fix issue #549 Divide by zero in start_task() by replacing time.time() by time.perf_counter()

Replaced all time.time() by time.perf_counter() in file emissions_tracker.py.

perf_counter gets the current time with higher precision.

LeahChercham commented 1 week ago

Hi @benoit-cty I deleted the forked-repo from my profile, is this a problem or where you able to get the changes of my pull request anyway ? (Sorry this is my first time contributing to a project)

benoit-cty commented 1 week ago

Yes it's a problem : image

But your code still appear there : https://github.com/mlco2/codecarbon/pull/570/files if you want to restore it.

You could delete the fork only after we merge the code to the master of CodeCarbon.

LeahChercham commented 1 week ago

I wasn't able to restore so I recreated this pull request: https://github.com/mlco2/codecarbon/pull/589