Commit 0ad83a24 authored by Philipp Huebner's avatar Philipp Huebner

Imported Upstream version 1.0.4

parent 71975a17
# Version 1.0.4
* Adds p1_time_compat:unique_timestamp() that returns value resembling what now() was returning
# Version 1.0.3
* Added time related compatibility module, added API documentation (Paweł Chmielowski)
......@@ -5,7 +9,8 @@
# Version 1.0.2
* Add p1_time_compat module to ease support for both R17 and R18 Erlang time features (Paweł Chmielowski)
* Add p1_time_compat module to ease support for both R17 and R18
Erlang time features (Paweł Chmielowski)
# Version 1.0.1
......
......@@ -53,6 +53,7 @@
time_offset/1,
convert_time_unit/3,
timestamp/0,
unique_timestamp/0,
unique_integer/0,
unique_integer/1,
monitor/2,
......@@ -107,6 +108,9 @@ convert_time_unit(Time, FromUnit, ToUnit) ->
timestamp() ->
erlang:now().
unique_timestamp() ->
erlang:now().
unique_integer() ->
{MS, S, US} = erlang:now(),
(MS*1000000+S)*1000000+US.
......@@ -249,6 +253,10 @@ convert_time_unit(Time, FromUnit, ToUnit) ->
timestamp() ->
erlang:timestamp().
unique_timestamp() ->
{MS, S, _} = erlang:timestamp(),
{MS, S, erlang:unique_integer([positive, monotonic])}.
unique_integer() ->
erlang:unique_integer().
......
{application, p1_utils,
[
{description, "Erlang utility modules from ProcessOne"},
{vsn, "1.0.3"},
{vsn, "1.0.4"},
{modules, []},
{registered, []},
{applications, [
......
......@@ -141,7 +141,7 @@ priority_from_current_time() ->
priority_from_current_time(MsOffset) ->
{MS, S, US} = now(),
-(MS*1000000+S)*1000000+US.
-((MS*1000000+S)*1000000+US) + MsOffset.
-else.
......@@ -150,7 +150,7 @@ priority_from_current_time(MsOffset) ->
0 ->
{-erlang:monotonic_time(micro_seconds), -erlang:unique_integer([positive])};
_ ->
{-erlang:monotonic_time(micro_seconds)+MsOffset, 0}
{-erlang:monotonic_time(micro_seconds) + MsOffset, 0}
end.
-endif.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment