How to check Time when player is join the room in Unity Photon Networking

i am working on multi-player game in unity using photon network. i have an issue of checking the time when players are joined the lobby or joined the room. i set the room Option max Player is 4.
now i want that within 30 seconds the next level starts rather there will be 2 players or less than 5 or more than one who joined the lobby and i also want to know that if more than 5 users then how i will create another room for one user. how can i do this, anybody can tell me please.

You can easily create this workflow from within a room, as you can close it any time.

Do random matchmaking. Try to find any room and if there is none, create a new one. Every player does this.

Players in a room measure the time since the first player got in. After X seconds, the room gets closed (the Master Client sets PhotonNetwork.room.isOpen = false) and hidden (PhotonNetwork.room.isVisible = false). That takes the room out of random matchmaking. And you’re done.

One exception: If there is only one player in the room, don’t close it yet. Wait some longer.