Measuring time in milliseconds

More
4 years 8 months ago #93871 by aleksandrina555
aleksandrina555 created the topic: Measuring time in milliseconds
Hello everyone!
LimeSurvey saves time of answering to each question in seconds. I was wondering if there is possibility to measure time in milliseconds?
Thank you!

Please Log in to join the conversation.

More
4 years 8 months ago #93898 by tpartner
tpartner replied the topic: Measuring time in milliseconds
Not "out of the box".

You could add a question to every group and use JavaScript to hide them and load the exact time between page load and submit click.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
4 years 8 months ago #93941 by helper
helper replied the topic: Measuring time in milliseconds
Open .../application/controllers/admin/responses.php
find the following:
                    $minutes = (int) ($browsedatafield[$i] / 60);
                    $seconds = $browsedatafield[$i] % 60;
                    $browsedatafield[$i] = '';
                    if ($minutes > 0)
                        $browsedatafield[$i] .= "$minutes min ";
                    $browsedatafield[$i] .= "$seconds s";
replace with:
                    $minutes = (int) ($browsedatafield[$i] / 60);
                    $seconds = $browsedatafield[$i] % 60;
                    $ms = $browsedatafield[$i] % 1000;
                    $browsedatafield[$i] = '';
                    if ($minutes > 0)
                        $browsedatafield[$i] .= "$minutes min ";
                    $browsedatafield[$i] .= $seconds.".".$ms." s";

Please Log in to join the conversation.

More
4 years 8 months ago #93993 by helper
helper replied the topic: Measuring time in milliseconds
Better:
                    $minutes = $browsedatafield[$i] / 60;
                    $min = (int) $minutes;
                    $seconds = sprintf("%.2f",($minutes - $min) * 60);
                    $browsedatafield[$i] = '';
                    if ($minutes > 0)
                        $browsedatafield[$i] .= $min."m ";
                    $browsedatafield[$i] .= $seconds."s ";

Please Log in to join the conversation.

More
4 years 8 months ago #94053 by aleksandrina555
aleksandrina555 replied the topic: Measuring time in milliseconds
Thank you a lot!

Please Log in to join the conversation.

More
4 years 7 months ago #94063 by helper
helper replied the topic: Measuring time in milliseconds
Glad that things worked out for you... just a word of caution though - If you do an update to your LimeSurvey, the changes that you made to the file may be overwritten.

Please Log in to join the conversation.

More
4 years 4 months ago #97885 by ahavlik
ahavlik replied the topic: Measuring time in milliseconds
where it says: $ms = $browsedatafield[$i] % 1000;

it worked if instead we did: $ms = ($browsedatafield[$i]*1000) % 1000;
for version 1.91+

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!