text stringlengths 0 234 |
|---|
end Finish; |
end Wavefile_Benchmark; |
Benchmark_Using_Tasking : constant Boolean := False; |
begin |
if Argument_Count >= 1 then |
CPU_MHz := Float'Value (Argument (1)); |
end if; |
if Verbose then |
Put_Line ("Using CPU @ " & Float'Image (CPU_MHz) & " MHz"); |
end if; |
if Benchmark_Using_Tasking then |
declare |
Wav_Benchmark : Wavefile_Benchmark; |
begin |
Wav_Benchmark.Finish (Results); |
Function Definition: procedure Open_Wavefile; |
Function Body: procedure Close_Wavefile; |
function kHz_Per_Sample |
(Elapsed_Time : Time_Span; |
CPU_MHz : Float; |
Number_Ch : Positive; |
Number_Samples : Long_Long_Integer) return Float; |
procedure Display_Info (Elapsed_Time : Time_Span; |
CPU_MHz : Float; |
Number_Ch : Positive; |
Number_Samples : Long_Long_Integer; |
Sample_Rate : Positive); |
------------------- |
-- Open_Wavefile -- |
------------------- |
procedure Open_Wavefile is |
Wav_In_File_Name : constant String := "2ch_long_noise.wav"; |
Wav_Out_File_Name : constant String := "dummy.wav"; |
begin |
WF_In.Open (In_File, Wav_In_File_Name); |
WF_Out.Set_Format_Of_Wavefile |
(WF_In.Format_Of_Wavefile); |
WF_Out.Create (Out_File, Wav_Out_File_Name); |
end Open_Wavefile; |
-------------------- |
-- Close_Wavefile -- |
-------------------- |
procedure Close_Wavefile is |
begin |
WF_In.Close; |
WF_Out.Close; |
end Close_Wavefile; |
-------------------- |
-- kHz_Per_Sample -- |
-------------------- |
function kHz_Per_Sample |
(Elapsed_Time : Time_Span; |
CPU_MHz : Float; |
Number_Ch : Positive; |
Number_Samples : Long_Long_Integer) return Float |
is |
Factor : constant Long_Long_Float := (Long_Long_Float (Number_Samples) |
* Long_Long_Float (Number_Ch)); |
begin |
return Time_Span_Conversions.To_kHz (Elapsed_Time, CPU_MHz, Factor); |
end kHz_Per_Sample; |
------------------ |
-- Display_Info -- |
------------------ |
procedure Display_Info (Elapsed_Time : Time_Span; |
CPU_MHz : Float; |
Number_Ch : Positive; |
Number_Samples : Long_Long_Integer; |
Sample_Rate : Positive) |
is |
use Time_Span_Conversions; |
package F_IO is new Ada.Text_IO.Float_IO (Float); |
-- Duration_In_Seconds : Long_Long_Float := |
-- Long_Long_Float (Number_Samples) |
-- / Long_Long_Float (Sample_Rate); |
Factor : constant Long_Long_Float := (Long_Long_Float (Number_Samples) |
* Long_Long_Float (Number_Ch)); |
begin |
Put ("CPU time: "); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.