Ada Conformity Assessment Authority      Home Conformity Assessment   Test Suite ARGAda Standard
Annotated Ada Reference Manual (Ada 2022)Legal Information
Contents   Index   References   Search   Previous   Next 

D.14.3 Execution Time of Interrupt Handlers

{AI05-0170-1} {AI05-0299-1} This subclause describes a language-defined package to measure the execution time of interrupt handlers. 

Static Semantics

{AI05-0170-1} The following language-defined library package exists: 
{AI12-0241-1} {AI12-0302-1} with Ada.Interrupts;
package Ada.Execution_Time.Interrupts
   with Nonblocking, Global => in out synchronized
   function Clock (Interrupt : Ada.Interrupts.Interrupt_Id)
        return CPU_Time;
   function Supported (Interrupt : Ada.Interrupts.Interrupt_Id)
        return Boolean;
end Ada.Execution_Time.Interrupts;
{AI05-0170-1} The execution time or CPU time of a given interrupt Interrupt is defined as the time spent by the system executing interrupt handlers identified by Interrupt, including the time spent executing run-time or system services on its behalf. The mechanism used to measure execution time is implementation defined. Time spent executing interrupt handlers is distinct from time spent executing any task. 
Discussion: The implementation-defined mechanism here is the same as that covered by the Documentation Requirements of D.14, so we don't repeat that requirement here. 
{AI05-0170-1} For each interrupt, the execution time value is initially set to zero.

Dynamic Semantics

{AI05-0170-1} The function Clock returns the current cumulative execution time of the interrupt identified by Interrupt. If Separate_Interrupt_Clocks_Supported is set to False the function raises Program_Error.
{AI05-0170-1} {AI05-0264-1} The function Supported returns True if the implementation is monitoring the execution time of the interrupt identified by Interrupt; otherwise, it returns False. For any Interrupt_Id Interrupt for which Supported(Interrupt) returns False, the function Clock(Interrupt) will return a value equal to Ada.Execution_Time.Time_Of(0).

Extensions to Ada 2005

{AI05-0170-1} The package Execution_Time.Interrupts is new. 

Contents   Index   References   Search   Previous   Next 
Ada-Europe Ada 2005 and 2012 Editions sponsored in part by Ada-Europe