开始停止恢复ajax

This is the script i've scrapped togheter, its just an basic stop time watch script, i want some input in how to add an resume and start button. And i want to be able to send ajax calls when it started when it paused when it stopped.

var timer;
$(function () {
    $('#dateTime').html(getDateTime());
    timer = setTimeout(function () {
        update();
    }, 1000);
    $('#btn').click(function () {
        clearTimeout(timer);
        var currentdatetime = getDateTime();
    });
});

function update() {
    $('#dateTime').html(getDateTime());

    timer = setTimeout(function () {
        update();
    }, 1000);
}

function getDateTime() {
    var currentdate = new Date();
    var datetime = "Timer: " + currentdate.getDate() + "/" + (currentdate.getMonth() + 1) + "/" + currentdate.getFullYear() + " " + currentdate.getHours() + ":" + currentdate.getMinutes() + ":" + currentdate.getSeconds();
    return datetime;
}
var timer;

function resume() {
    update();
    $('#resume').off("click", resume);
    $('#pause').on("click", pause);
    // make start / resume ajax call here
}

function pause() {
    clearTimeout(timer);
    $('#resume').on("click", resume);
    $('#pause').off("click", pause);
    // make pause / stop ajax call here
}

function update() {
    $('#dateTime').html(getDateTime());

    timer = setTimeout(function () {
        update();
    }, 1000);
}

function getDateTime() {
    var currentdate = new Date();
    var datetime = "Timer: " + currentdate.getDate() + "/" + (currentdate.getMonth() + 1) + "/" + currentdate.getFullYear() + " " + currentdate.getHours() + ":" + currentdate.getMinutes() + ":" + currentdate.getSeconds();
    return datetime;
}

$(function () {
    resume();
});