Herod's temple, standing at the time of the Lord's ministry on earth, was destroyed by the Romans before this book was written.
The temple mentioned here is therefore a new one built before the tribulation or just at its beginning. Its measuring, including the altar and the worshippers, is a warning of imminent judgment: Jerusalem will be occupied by Gentiles (the nations) during the last three and a half years, also called the abomination that causes desolation (Dan.9:27, 12:11, Mat 24:15, 2 Thes.2:3-4, Rev.13:15).
There is much speculation among scholars as to the identity of the two witnesses. It is best to simply keep to what is revealed here: they are the two olive trees and the two lamp stands that stand before the Lord of the earth, two individual persons. There is a precedent in Scripture, in the case of Joshua and Zerubbabel who were the Lord's witnesses when Solomon's temple was reconstructed (Hag.1:1,14, Zech.3:1, 4:6).
The oil of the lamp stand is a figure of the Holy Spirit, whereas Israel is represented as an olive tree, from which we may deduce that the witnesses are two Spirit-filled Christian Jews. Two witnesses were required to establish the truth according to the Law (Deut.19:15, John8:17). Sackcloth represents mourning and repentance (Gen.37:34, Jonah3:8).
They testify powerfully during 1260 days, or 3.5 years of 360 days, and then they will be attacked and killed by the beast that comes from the Abyss, identified as the Antichrist. After 3.5 days they will rise again and be taken to heaven (part of the first resurrection, which started with Christ, then the Church). After this interlude, the third woe is to start on the sounding of the seventh trumpet.
The Two Witnesses
1 Then I was given a reed like a measuring rod. And the angel stood, saying, "Rise and measure the temple of God, the altar, and those who worship there.
2 "But leave out the court which is outside the temple, and do not measure it, for it has been given to the Gentiles. And they will tread the holy city underfoot for forty-two months.
3 "And I will give power to my two witnesses, and they will prophesy one thousand two hundred and sixty days, clothed in sackcloth."
4 These are the two olive trees and the two lampstands standing before the God of the earth.
5 And if anyone wants to harm them, fire proceeds from their mouth and devours their enemies. And if anyone wants to harm them, he must be killed in this manner.
6 These have power to shut heaven, so that no rain falls in the days of their prophecy; and they have power over waters to turn them to blood, and to strike the earth with all plagues, as often as they desire.
The Witnesses Killed
7 When they finish their testimony, the beast that ascends out of the bottomless pit will make war against them, overcome them, and kill them.
8 And their dead bodies will lie in the street of the great city which spiritually is called Sodom and Egypt, where also our Lord was crucified.
9 Then those from the peoples, tribes, tongues, and nations will see their dead bodies three-and-a-half days, and not allow their dead bodies to be put into graves.
10 And those who dwell on the earth will rejoice over them, make merry, and send gifts to one another, because these two prophets tormented those who dwell on the earth.
The Witnesses Resurrected
11 Now after the three-and-a-half days the breath of life from God entered them, and they stood on their feet, and great fear fell on those who saw them.
12 And they heard a loud voice from heaven saying to them, "Come up here." And they ascended to heaven in a cloud, and their enemies saw them.
13 In the same hour there was a great earthquake, and a tenth of the city fell. In the earthquake seven thousand people were killed, and the rest were afraid and gave glory to the God of heaven.
14 The second woe is past. Behold, the third woe is coming quickly.
Rev 11:1-14 (NKJV)