If you use Server Sent Events you can have a connection to a PHP script that runs in an infinite loop that pushes out the data to a javascript listener.
<?php
    /*
        diskspace_sse.php
    */
    set_time_limit( 0 );
    ini_set('auto_detect_line_endings', 1);
    ini_set('max_execution_time', '0');
    /* -- Edit to suit your location -- */
    date_default_timezone_set( 'Europe/London' );
    ob_end_clean();
    /* -- set headers -- */
    header('Content-Type: text/event-stream'); /* !important! */
    header('Cache-Control: no-cache');
    header('Access-Control-Allow-Credentials: true');
    header('Access-Control-Allow-Methods: GET');
    header('Access-Control-Expose-Headers: X-Events');  
    /* -- utility function to send formatted sse message -- */
    if( !function_exists('sse_message') ){
        function sse_message( $evtname='gas', $data=null, $retry=1000 ){
            if( !is_null( $data ) ){
                echo "event:".$evtname."\r\n";
                echo "retry:".$retry."\r\n";
                echo "data:" . json_encode( $data, JSON_FORCE_OBJECT|JSON_HEX_QUOT|JSON_HEX_TAG|JSON_HEX_AMP|JSON_HEX_APOS );
                echo "\r\n\r\n";
            }
        }
    }
    /* -- How often to send messages -- */
    $sleep=1;
    $disk='c:';
    while( true ){
        if( connection_status() != CONNECTION_NORMAL or connection_aborted() ) {
            break;
        }
        /* Infinite loop is running - perform actions you need */
        $payload=array(
            'date'      =>  date(DATE_COOKIE),
            'diskspace' =>  disk_free_space($disk),
            'totalspace'=>  disk_total_space($disk),
            'formatted_diskspace'   =>  round( disk_free_space($disk) / pow( 1024,3 ), 2 ).'Gb',
            'formatted_total'       =>  round( disk_total_space($disk) / pow( 1024,3 ), 2 ).'Gb'
        );
        /* -- prepare sse message -- */
        sse_message( 'diskspace', $payload );
        /* -- Send output -- */
        if( @ob_get_level() > 0 ) for( $i=0; $i < @ob_get_level(); $i++ ) @ob_flush();
        @flush();
        /* wait */
        sleep( $sleep );
    }
    if( @ob_get_level() > 0 ) {
        for( $i=0; $i < @ob_get_level(); $i++ ) @ob_flush();
        @ob_end_clean();
    }
?>
In your html page
<div id='diskspace'></div>
<script type='text/javascript'>
    function bindEvtSource(){
        var url='http://localhost/diskspace_sse.php';
        if ( !!window.EventSource ) {
            var evtSource = new EventSource( url );
            evtSource.addEventListener( 'open', function(e){
                console.log(e.type);
            },false);
            evtSource.addEventListener( 'error', function(e){
                console.error('%o %s',e,e.type);
            },false);
            evtSource.addEventListener( 'diskspace', function(e){
                var json=JSON.parse(e.data);
                /* you could work with the json data here */
                getobject('diskspace').innerHTML=e.data;
            },false);
        } else {
            alert('Server Sent Events are not supported in this browser');
        }
    }
    document.addEventListener( 'DOMContentLoaded', bindEvtSource, false );
</script>
You should get feedback about the diskspace usage every second with no ( very little ) slowdown in page load times.