Changeset 17789 for trunk


Ignore:
Timestamp:
05/07/14 13:44:30 (10 years ago)
Author:
tbretz
Message:
Some updates to the time calculation (more accurate position); check as soon as possible if file contains data; read internal.js and execute it before the rest of the code.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/www/viewer/index.php

    r17774 r17789  
    193193
    194194$fil['runType']       = trim(fread($file, 80));
     195if (feof($file))
     196   return header('HTTP/1.0 400 Data not available.');
     197
    195198$fil['runStart']      = get($file, "d");
    196199$fil['runEnd']        = get($file, "d");
     
    328331    // 376, 720, 91.75 MiB
    329332
    330     $rc['startJs'] = microtime(true);
    331     $rc['timeJS']  = array();
     333    $internal = file_get_contents("internal.js");
    332334
    333335    // Buffer output from javascript
    334336    ob_start();
    335337
     338    $rc['timeJS']  = array();
     339    $rc['startJs'] = microtime(true);
     340
    336341    try
    337342    {
     343        $v8->executeString($internal, 'internal.js');
    338344
    339345        // We unpack the data pixel by pixel and copy the array directly to the
     
    371377    }
    372378
     379    $rc['timeJs'][2]  = (microtime(true) - $rc['startJs']);
     380
    373381    // Copy output buffer and clean it
    374382    $rc['debug'] = ob_get_contents();
    375383    ob_end_clean();
    376 
    377     // Get execution times
    378     $now = microtime(true);
    379 
    380     $rc['timeJs'][2]  = ($now - $rc['startJs']);
    381 }
    382 
    383 $rc['timePhp'] = ($now - $rc['startPhp']);
    384 
    385 $rc['memory'] = memory_get_peak_usage(true)/1024/1024;
     384}
     385
     386$rc['memory']  = memory_get_peak_usage(true)/1024/1024;
     387$rc['timePhp'] = (microtime(true) - $rc['startPhp']);
    386388
    387389//unset($rc['neighbors']);
Note: See TracChangeset for help on using the changeset viewer.