Can you give me an example of a sentence using the word when?

I was looking through my room when I found a pile of $100!

or

When I was skateboarding through the park I saw my friends.