Long-range entanglement generation via frequent measurements