home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Geek Gadgets 1
/
ADE-1.bin
/
ade-dist
/
gnat-2.06-src.tgz
/
tar.out
/
fsf
/
gnat
/
ada
/
s-tasclo.ads
< prev
next >
Wrap
Text File
|
1996-09-28
|
4KB
|
94 lines
------------------------------------------------------------------------------
-- --
-- GNU ADA RUNTIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . T A S K _ C L O C K --
-- --
-- S p e c --
-- --
-- $Revision: 1.11 $ --
-- --
-- Copyright (c) 1991,1992,1993,1994,1995 FSU, All Rights Reserved --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU Library General Public License as published by the --
-- Free Software Foundation; either version 2, or (at your option) any --
-- later version. GNARL is distributed in the hope that it will be use- --
-- ful, but but WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Gen- --
-- eral Library Public License for more details. You should have received --
-- a copy of the GNU Library General Public License along with GNARL; see --
-- file COPYING.LIB. If not, write to the Free Software Foundation, 675 --
-- Mass Ave, Cambridge, MA 02139, USA. --
-- --
------------------------------------------------------------------------------
-- This package interfaces with the Ada RTS and defines the low-level
-- timer operations.
with Interfaces;
package System.Task_Clock is
type Stimespec is private;
Stimespec_First : constant Stimespec;
Stimespec_Last : constant Stimespec;
Stimespec_Zero : constant Stimespec;
Stimespec_Unit : constant Stimespec;
Stimespec_Sec_Unit : constant Stimespec;
function Stimespec_Seconds (TV : Stimespec) return Integer;
function Stimespec_NSeconds (TV : Stimespec) return Integer;
function Time_Of (S, NS : Integer) return Stimespec;
function Stimespec_To_Duration (TV : Stimespec) return Duration;
function Duration_To_Stimespec (Time : Duration) return Stimespec;
function "-" (TV : Stimespec) return Stimespec;
function "+" (LTV, RTV : Stimespec) return Stimespec;
function "-" (LTV, RTV : Stimespec) return Stimespec;
function "*" (TV : Stimespec; N : Integer) return Stimespec;
function "/" (TV : Stimespec; N : integer) return Stimespec;
function "/" (LTV, RTV : Stimespec) return Integer;
function "<" (LTV, RTV : Stimespec) return Boolean;
function "<=" (LTV, RTV : Stimespec) return Boolean;
function ">" (LTV, RTV : Stimespec) return Boolean;
function ">=" (LTV, RTV : Stimespec) return Boolean;
private
-- Stimespec is represented in 64-bit Integer. It represents time in
-- nanoseconds. For example, 1 second and 1 nanosecond is represented
-- as "1_000_000_001"
type Stimespec is new Interfaces.Integer_64;
Stimespec_First : constant Stimespec := Stimespec'First;
Stimespec_Last : constant Stimespec := Stimespec'Last;
Stimespec_Zero : constant Stimespec := 0;
Stimespec_Unit : constant Stimespec := 1;
Stimespec_Sec_Unit : constant Stimespec := 10#1#E9;
end System.Task_Clock;