found a bug related to processes that last more than one day. Also optimized datetime.datetime.now() calls to only get called once per cycle.