/usr/share/psychtoolbox-3/PsychBasic/WaitTicks.m is in psychtoolbox-3-common 3.0.11.20140816.dfsg1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | function WaitTicks(wait)
% WaitTicks(wait)
%
% Wait the requested number of system ticks. One tick is 1/60.15 seconds.
%
% TIMING ADVICE: the first time you access any MEX function or M file,
% Matlab takes several hundred milliseconds to load it from disk.
% Allocating a variable takes time too. Usually you'll want to omit
% those delays from your timing measurements by making sure all the
% functions you use are loaded and that all the variables you use are
% allocated, before you start timing. MEX files stay loaded until you
% flush the MEX files (e.g. by changing directory or calling CLEAR
% MEX). M files and variables stay in memory until you clear them.
%
%
% Windows: ________________________________________________________________
%
% WaitTicks is implemented using WaitSecs.m, and each tick is interpreted
% as 1/60.15 seconds to be consistent with the Mac version.
% (In Windows, a system tick is usually 1 millisecond, but with a precision that
% varies from system to system. We're ignoring the system ticks here.)
%
% OS X: ___________________________________________________________________
%
% "Ticks" functions are deprecated, use "Secs" functions instead; To
% measure time, use GetSecs insted of GetTicks. To delay, use WaitSecs
% instead of WaitTicks.
%
% "Secs" functions are provided for OS 9, Windows, and OS X and are more precise
% and more accurate than "Ticks" functions.
%
% WaitTicks behaves exactly as on OS 9, relying on the Psychtoolbox mex
% function GetTicks to read the system tick count.
% _________________________________________________________________________
%
% See also: GetTicks, GetSecs, WaitSecs.
%
% 6/14/95 dhb Added to help.
% 1/29/97 dhb More comments.
% 3/15/97 dgp Expanded comments.
% 3/15/99 xmz Put in conditional for Windows.
% 2/12/04 awi Added the OS X case. Fixed the Windows case so that it
% waits an integer number of ticks. Simplified platform test
% expressions. Added test for unfamiliar platform. Added OS X
% section to comments.
if IsWindows
wait=ceil(wait);
WaitSecs(wait/60.15);
elseif IsOSX
ticks=GetTicks+wait;
while GetTicks<ticks
end
else
error('Platform unrecognized by Psychtoolbox');
end %else
|