They performed the Mishmeret Eloheihem and the Mishmeret HaTahorah according to the commandment of Dovid, and of Sh'lomo bno.