How Could I Make a Time Warp System?

Hello.

How could I go about creating a time warp system, like in Kerbal Space Program. In other words, when I click a button, I want time to speed up or slow down, and physics to happen faster. Thanks.