Count amount of times a boolean changed value

Tell us what this does ?