summaryrefslogtreecommitdiffstats
path: root/gcc/ada/s-osprim-mingw.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-07 13:22:34 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-07 13:22:34 +0000
commitad73b39701cd115f28e1a536c66d4a999de3f55c (patch)
tree0d62b778459616a301d7b5a24088c9a2ab8f5158 /gcc/ada/s-osprim-mingw.adb
parent1df25d19eea2f5f00fb28299c16e92d6f44cb1ff (diff)
downloadppe42-gcc-ad73b39701cd115f28e1a536c66d4a999de3f55c.tar.gz
ppe42-gcc-ad73b39701cd115f28e1a536c66d4a999de3f55c.zip
2009-07-07 Robert Dewar <dewar@adacore.com>
* s-osprim-mingw.adb: Minor reformatting Minor code reorganization * a-stzsea.adb, a-stwise.adb, a-strsea.adb (Index): Redo previous change (Ind should be Integer). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149327 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/s-osprim-mingw.adb')
-rw-r--r--gcc/ada/s-osprim-mingw.adb19
1 files changed, 7 insertions, 12 deletions
diff --git a/gcc/ada/s-osprim-mingw.adb b/gcc/ada/s-osprim-mingw.adb
index 0984f49cacc..4a916166535 100644
--- a/gcc/ada/s-osprim-mingw.adb
+++ b/gcc/ada/s-osprim-mingw.adb
@@ -157,13 +157,10 @@ package body System.OS_Primitives is
-- actions should be null.
Max_Elapsed : constant := 0;
-
epoch_1970 : constant := 16#19D_B1DE_D53E_8000#; -- win32 UTC epoch
system_time_ns : constant := 100; -- 100 ns per tick
Sec_Unit : constant := 10#1#E9;
-
Test_Now : aliased Long_Long_Integer;
-
Loc_Ticks : aliased LARGE_INTEGER;
Loc_Time : aliased Long_Long_Integer;
Elapsed : Long_Long_Integer;
@@ -181,8 +178,8 @@ package body System.OS_Primitives is
-- time API.
-- Try at most 10th times to reach the best synchronisation (below 1
- -- millisecond) otherwise the runtime will use the best value
- -- reached during the runs.
+ -- millisecond) otherwise the runtime will use the best value reached
+ -- during the runs.
for K in 1 .. 10 loop
GetSystemTimeAsFileTime (Loc_Time'Access);
@@ -219,17 +216,15 @@ package body System.OS_Primitives is
function Monotonic_Clock return Duration is
Current_Ticks : aliased LARGE_INTEGER;
Elap_Secs_Tick : Duration;
-
begin
if QueryPerformanceCounter (Current_Ticks'Access) = Win32.FALSE then
return 0.0;
+ else
+ Elap_Secs_Tick :=
+ Duration (Long_Long_Float (Current_Ticks - BMTA.all) /
+ Long_Long_Float (TFA.all));
+ return BMCA.all + Elap_Secs_Tick;
end if;
-
- Elap_Secs_Tick :=
- Duration (Long_Long_Float (Current_Ticks - BMTA.all) /
- Long_Long_Float (TFA.all));
-
- return BMCA.all + Elap_Secs_Tick;
end Monotonic_Clock;
-----------------
OpenPOWER on IntegriCloud