John was given a rod and told to measure the Temple building but not the Temple court, with the reason that the Temple court will be given to the Gentiles for three and a half years. This may refer to the time when the non-believers, being referred to as Gentiles, will control God's place for three and a half years. For the same amount of time, power will be given to two witnesses who will prophesy.
These two witnesses will have great power and if anyone tried to harm them, they will shoot fire from their mouths. They have the power to stop the rain and to turn water to blood and to cause plagues on earth. However, when they finished their testimony, they are allowed to be defeated by the evil from the bottomless pit. The place where this occurred is the place where the Lord was crucified, which is Jerusalem, and the passage also calls it the spiritual Sodom and Egypt - perhaps showing the spiritual state of Jerusalem at that time.
Since the two witnesses preached on things the non-believers hated to hear, the non-believers will rejoice at their deaths. The people wanted the death of these two witnesses so much that they did not allow the bodies to be buried, so they can see their dead bodies all day. However, after three and a half days, the Spirit brought the witnesses back to life and they ascended to heaven. As the people saw this, there was also an earthquake that destroyed a tenth of the city and over seven thousand men.
Then the seventh angel sounded the shofar. Heaven declares the earth to belong to the Lord and the twenty four elders worshipped and thanked God. They declare that God's judgment has come and the wicked shall be judged while God's servants will be rewarded. Heaven was opened, revealing the ark of his testament and the earth rumbled with lightnings, earthquakes, thunders and hail.
Revelation 11
The Two Witnesses
1 Then I was given a reed like a measuring rod. And the angel stood,[a] 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[b] 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[c] 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[d] 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[e] 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.
Seventh Trumpet: The Kingdom Proclaimed
15 Then the seventh angel sounded: And there were loud voices in heaven, saying, “The kingdoms[f] of this world have become the kingdoms of our Lord and of His Christ, and He shall reign forever and ever!” 16 And the twenty-four elders who sat before God on their thrones fell on their faces and worshiped God, 17 saying:
“We give You thanks, O Lord God Almighty,
The One who is and who was and who is to come,[g]
Because You have taken Your great power and reigned.
18 The nations were angry, and Your wrath has come,
And the time of the dead, that they should be judged,
And that You should reward Your servants the prophets and the saints,
And those who fear Your name, small and great,
And should destroy those who destroy the earth.”
19 Then the temple of God was opened in heaven, and the ark of His covenant[h] was seen in His temple. And there were lightnings, noises, thunderings, an earthquake, and great hail.