Welcome, Guest
Username: Password: Remember me

TOPIC: Measuring time in milliseconds

Measuring time in milliseconds 1 year 6 months ago #93871

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!
The administrator has disabled public write access.

Measuring time in milliseconds 1 year 6 months ago #93898

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 4195
  • Thank you received: 789
  • Karma: 359
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Measuring time in milliseconds 1 year 6 months ago #93941

  • helper
  • helper's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 126
  • Thank you received: 18
  • Karma: 0
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";
The administrator has disabled public write access.

Measuring time in milliseconds 1 year 6 months ago #93993

  • helper
  • helper's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 126
  • Thank you received: 18
  • Karma: 0
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 ";
The administrator has disabled public write access.

Measuring time in milliseconds 1 year 6 months ago #94053

Thank you a lot!
The administrator has disabled public write access.

Measuring time in milliseconds 1 year 6 months ago #94063

  • helper
  • helper's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 126
  • Thank you received: 18
  • Karma: 0
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.
The administrator has disabled public write access.

Measuring time in milliseconds 1 year 2 months ago #97885

  • ahavlik
  • ahavlik's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 6
  • Thank you received: 1
  • Karma: 0
where it says: $ms = $browsedatafield[$i] % 1000;

it worked if instead we did: $ms = ($browsedatafield[$i]*1000) % 1000;
for version 1.91+
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.279 seconds
Donation Image