So I wanted to make a stopwatch app that had some extra sports tracking features built in. I'm using this angular timer library for the stopwatch (with copied-from-the-docs start and stop buttons), then adding text to a list with a button- pretty straightforward.
var app = angular.module('myTimer', ['timer'])
.controller('MainCtrl', ['$scope', function($scope){
$scope.init = true;
$scope.timerRunning = false;
$scope.startTimer = function() {
// calling init on a running timer borks it
if ($scope.init) {
$scope.$broadcast('timer-start');
$scope.init = false;
}
else {
$scope.$broadcast('timer-resume');
}
$scope.timerRunning = true;
};
$scope.stopTimer = function() {
$scope.$broadcast('timer-stop');
$scope.timerRunning = false;
};
}]);
Unfortunately, loading the page over localhost on mobile (iPhone 5S, iOS 8.1) works, but there's about a half second delay between pressing the start/stop button and the timer reacting- not exactly a pleasant user experience.
I also tried a jQuery implementation which ran faster, but still not as snappy as the same site on desktop (or the native timer, understandably).
So my question is this: is there any configuration of javascript I can do to make this run quickly? I haven't done any mobile app development, so completing this project web based would be ideal.
Thanks!