How to save and display players times using Playerprefs in Javascript?

How can I save and display players times to complete the game using playerprefs in Unity3D? The reason why I’m asking is because I can’t find any example code in Javascript that is simple to use and understand. Please provide example code for explanation. Thanks

Something like this:

var time : float; //this is the time that you want to save in PlayerPrefs

PlayerPrefs.SetFloat("Players Time", time); //This is how you save it (probably when the player finishes or loses right)

PlayerPrefs.Save();  //this is needed to actually save the times so they can accessed later

var guiTime : float = PlayerPrefs.GetFloat("Players Time", time); //to retrieve the time


You may need to have multiple values like Players Time1, Players Time2, etc, since only one float can be saved at a time.

Edit: Also you may not need playerPrefs. Playerprefs is really only necessary if you want to save a variable after the game as closed.