Back to project page BarrelRace.
The source code is released under:
MIT License
If you think the Android project BarrelRace listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.app.ui.assignment.barrelrace.util; //from ww w .jav a 2 s . c om /** * @author Vasu Irneni * @description Barrel Race Game for Android * @module TimerUtil */ /*Format Time based on the elapsedTime value*/ public class TimerUtil { public String formatTime(long timeElapsed) { int timeDiff = (int) (timeElapsed/1000); int minutes = timeDiff/60; int seconds = timeDiff % 60; int milliseconds = (int) (timeElapsed % 1000); return minutes + ":" + String.format("%02d", seconds) + ":" + String.format("%03d", milliseconds); } }