How can I get in-game playtime with python?

Hi, I want to make some GUI python program which alert enomy attack is coming.

For this, I need to get in-game playtime. How can I get this with python API, pysc2?