Is there a quick method to make a sawtooth structure? Is there a quick/easy way to make the following shape?

I was making the following shape, and the method I ended up using was loop-cutting a box, then extruding all the top edges up. This gave me all the vertices I needed, but there was still a lot of removing and adding of faces to do. 

I also tried using the Rip Fill tool, but that made a mess of my geometry.

I was curious if there was a better way?
For repeated shapes, the obvious answer is “make one copy, then add an array modifier”. You can apply the modifier if you want to further edit the geometry, otherwise you can leave it in place.