Pulse counter - Send data after x minutes OR after x pulses

Hi all,
I want to build a pulse counter based on ESPhome.
Generally the pulse counter should send all 10 minutes the counted pulses (and then reset to 0 again) to an influxDB.
But, if 100 pulses are counted, the data should be send immediately, to increase the resolution.
Is this possible?
Thanks Fuxx