Allow passing in a function to use instead of time.time.

Summary: This is useful, for example, if time.time is mocked out in tests.

Test Plan:
Hooked it up to the test runner, it worked.  Tested in-browser that it didn't
break anything.

Reviewers: alan

Reviewed By: alan

Differential Revision: http://phabricator.khanacademy.org/D11904