<?php

    require_once('config.php');

    $users = 10000; /// Modify me to specify the number of users to calculate
    $step  = 10;  /// Pick step

/// Don't modify anything below this line

    $totaltime = 0;
    $totalcount= 0;
    $hash      = '';

    for ($i=0;$i<$users;$i++) {
        $userid = $i*$step;
        if (record_exists('user', 'id', $userid)) {
            $start = microtime(true);
            $uas = get_user_access_sitewide($userid);
            $end = microtime(true);
            $totaltime += $end - $start;
            $totalcount++;
            $hash = md5($hash . md5(serialize($uas)));
        }
    }

    echo "Real users processed: $totalcount \n";
    echo "Time spent in get_user_access_sitewide(): $totaltime \n";
    echo "HASH of the whole operation: $hash \n";

?>

