count clock edges