Use singular names for time units, as in Erlang/OTP 19.1. Fix #5236 (#5244)

This commit is contained in:
Alexei Sholik
2016-09-22 23:28:13 +03:00
committed by GitHub
parent b1e1fababb
commit 707b965d21
7 changed files with 49 additions and 31 deletions
+1 -1
View File
@@ -69,7 +69,7 @@ defmodule ProcessTest do
end
test "send_after/4 with absolute time sends message once expired" do
time = System.monotonic_time(:milliseconds) + 10
time = System.monotonic_time(:millisecond) + 10
Process.send_after(self(), :hello, time, abs: true)
assert_receive :hello
end
+9 -9
View File
@@ -150,8 +150,8 @@ defmodule SystemTest do
end
test "monotonic_time/1" do
assert is_integer(System.monotonic_time(:nanoseconds))
assert abs(System.monotonic_time(:microseconds)) < abs(System.monotonic_time(:nanoseconds))
assert is_integer(System.monotonic_time(:nanosecond))
assert abs(System.monotonic_time(:microsecond)) < abs(System.monotonic_time(:nanosecond))
end
test "system_time/0" do
@@ -159,13 +159,13 @@ defmodule SystemTest do
end
test "system_time/1" do
assert is_integer(System.system_time(:nanoseconds))
assert abs(System.system_time(:microseconds)) < abs(System.system_time(:nanoseconds))
assert is_integer(System.system_time(:nanosecond))
assert abs(System.system_time(:microsecond)) < abs(System.system_time(:nanosecond))
end
test "time_offset/0 and time_offset/1" do
assert is_integer(System.time_offset())
assert is_integer(System.time_offset(:seconds))
assert is_integer(System.time_offset(:second))
end
test "os_time/0" do
@@ -173,8 +173,8 @@ defmodule SystemTest do
end
test "os_time/1" do
assert is_integer(System.os_time(:nanoseconds))
assert abs(System.os_time(:microseconds)) < abs(System.os_time(:nanoseconds))
assert is_integer(System.os_time(:nanosecond))
assert abs(System.os_time(:microsecond)) < abs(System.os_time(:nanosecond))
end
test "unique_integer/0 and unique_integer/1" do
@@ -184,8 +184,8 @@ defmodule SystemTest do
end
test "convert_time_unit/3" do
time = System.monotonic_time(:nanoseconds)
assert abs(System.convert_time_unit(time, :nanoseconds, :microseconds)) < abs(time)
time = System.monotonic_time(:nanosecond)
assert abs(System.convert_time_unit(time, :nanosecond, :microsecond)) < abs(time)
end
test "schedulers/0" do