File: GetSecsTick.m

package info (click to toggle)
psychtoolbox-3 3.0.19.14.dfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 86,796 kB
  • sloc: ansic: 176,245; cpp: 20,103; objc: 5,393; sh: 2,753; python: 1,397; php: 384; makefile: 193; java: 113
file content (29 lines) | stat: -rw-r--r-- 1,115 bytes parent folder | download | duplicates (7)
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
function tickDuration=GetSecsTick
% tickDuration=GetSecsTick
% 
% GetSecsTick returns the fraction of a second which is a tick of the GetSecs clock. 
% 
% See also: GetSecs, WaitTicks, GetTicks, GetTicksTick, GetBusTicks, GetBusTicksTick.

% 3/15/02  awi  wrote it.
% 4/02/02  awi  Changed the return value to the clock period from the clock frequency. 
%               Changed the name from "GetTimeBase" to "GetSecsTick".
%               Added script provided by Denis for OS9 version of the Psychtoolbox
% 7/10/04  awi  Changed for OSX by adding GetBusTicks and GetBusTicksTick
%               to see also. Replaced streq with AssertMex and isOS9.
% 10/4/05  awi  Note here cosmetic changes by dgp between 7/10/04 and 10/4/05. 

% On Windows and OSX this is only a help file and should not execute.
AssertMex('Win','OSX');

if isOS9
	available=Screen('Preference','Available');
        if available.UpTime
           tickDuration=1e-9; % UpTime tick (a rough guess)
		else
           tickDuration=8e-6; % Microseconds tick (a rough guess)
	end   
else
    error('Platform unsupported by the Psychtoolbox');
end