Write stats every 5s