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.)
%
% 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.

c = computer;
if (all(c(1:2)=='PC'))
   WaitSecs(double(wait)/60.15);
else
	ticks=GetTicks+wait;
	while GetTicks<ticks
   end
end
