Many Torah sages of the earlier generations would recite the Tikun Hasot prayer at or after midnight every night, mourning the destruction of the Bet Hamikdash, the death of the righteous Sadikim, and the exile of the Jewish people and the Shechina (Divine Presence). Students of Rav Yaakob Haim Sofer (Baghdad-Israel, 1870-1939) witnessed their Rabbi entering a room at night and weeping bitterly over the destruction. This was reportedly the practice of the Hatam Sofer (Rabbi Moshe Sofer of Pressburg, 1762-1839), as well. And it is told that Rabbi Yehuda Asad, author of the famous work of responsa Yehuda Yaale, would collect the tears he shed while reciting Tikun Hasot and perform different kinds of miracles with them.
The Arizal (Rabbi Yishak Luria of Safed, 1534-1572) taught that one should especially make a point of reciting the Tikun Rahel portion of Tikun Hasot at or after midnight each night during the three-week period between Shiba Asar Be’Tamuz and Tisha B’Ab. More generally, it is proper for everyone to designate some time each day and/or night to contemplate the tragedy of the Hurban (destruction of the Temple and Jerusalem) and pray for the Temple’s restoration.
A student posed an interesting question to Hachan Ben Sion Abba Shaul (Israel, 1923-1998) regarding the recitation of Tikun Hasot. This student felt that if he would recite Tikun Hasot in the middle of the night, he would be unable to wake up in time to recite the morning Shaharit prayer "Ke’vatikin" – at sunrise. The question thus arose whether it would be preferable for him to not recite Tikun Hasot so he could wake up in time to pray at sunrise, or to recite Tikun Hasot and pray Shaharit at a later time in the morning. (Of course, he would ensure to recite Shema and the Amida prayer before the final times for these recitations.) Is it more important to recite Tikun Hasot, or to pray "Ke’vatikin," reciting Shema just before sunrise and the Amida and sunrise?
The Rambam (Rabbi Moshe Maimonides, Spain-Egypt, 1135-1204), in a famous ruling, maintained that praying Shaharit later than sunrise has the status of "Bedi’avad." This means that although one fulfills his obligation if he prays at that time, one must try to pray earlier, at sunrise. In the Rambam’s view, one must endeavor to recite Shema just before sunrise and begin the Amida at sunrise, despite the fact that one who prays later nevertheless fulfills his obligation. The Shulhan Aruch does not follow this view, and rules that praying "Ke’vatikin" constitutes a "Misva Min Ha’mubhar" – an especially high standard of observance, rather than a strict requirement. According to Halacha, then, although it is certainly commendable to pray at sunrise, one is not required to do so.
Therefore, Hacham Ben Sion Abba Shaul ruled that it is preferable to recite Tikun Hasot even at the expense of praying "Ke’vatikin." Since, as mentioned, praying at sunrise is not a requirement, but rather an exceptionally high standard of observance, it does not override the important practice of Tikun Hasot. He therefore ruled that a person should recite Tikun Hasot even if this will preclude the possibility of his waking in time to pray at sunrise.
Summary: During the "three weeks," one should make a point of allocating some time each day and/or night to contemplate the significance of the Temple’s destruction. Preferably, one should recite the Tikun Rahel section of Tikun Hasot prayer each night at midnight (or later in the night) during the "three weeks," even if this will preclude the possibility of his waking up early enough in the morning to pray Shaharit "Ke’vatikin" (at sunrise).