I need to pay someone for a live counter that adds one each 1.7 seconds.


It is the real time count of Heart Failures worldwide.



Here is a simple derivative of the linked thread above.

I want to let you know that this is also a hybrid ( PHP and Javascript). I don't normally use server side time in displaying user time zone related content, but we need a reliable time reference.

our simple function.. save as cases.php


    function get_cases()
        ## define current server time
        $time = time();

        ## define time beginning e.g. january of this year
        $beg_time = strtotime('2014-01-01 00:00:00');

        ## calculate elapsed time since beg_time
        $elapsed_time = round($time - $beg_time);

        ## return everything as array 

        return array( 

            'time'=> $time, 
            'case_today' => round(($time - (strtotime("00:00"))) / 1.7), 
            'beg_time' => $beg_time, 
            'elapsed_time' => round($time - $beg_time), 
            'ytd_cases' => round($elapsed_time / 1.7)


    $res = get_cases();

    ## test if we can access array output
    //echo $res['beg_time'].'<br/>';
    //echo $res['time'].'<br/>';


The page that will display your incrementation. Save as counter.php



<!DOCTYPE html>
    <script type="text/javascript">

        function getCurrentTime(){

            return <?php echo $res['time'];?>;

        var timeSinceEpoch = getCurrentTime(); 


        var heartFailure = <?php echo $res['ytd_cases'];?> ; // this is the total cases since beginning
        var caseToday = <?php echo $res['case_today'];?>;

        function casesAsOfToday(){

            document.getElementById('cases_today').innerHTML = 'Cases today ' + caseToday;


        function countFailure() {

            document.getElementById('heart_failure').innerHTML = 'Year to date cases: ' + heartFailure;
        setInterval('countFailure()', 1700);




    <div id="heart_failure"></div>

    <div id="cases_today"></div>


that's pretty much it. You can style the integer count by adding CSS. So, this

<div id="heart_failure"></div>

can have class attribute

<div id="heart_failure" class="your_class"></div>