K2InformaticsGmbH / erloci

Erlang Oracle native driver - DEPRECATED, see https://github.com/K2InformaticsGmbH/oranif instead
Apache License 2.0
37 stars 11 forks source link

Removed deprecated erlang 19 warnings #48

Closed shamis closed 7 years ago

shamis commented 7 years ago

changed random module to rand and erlang:now() to os:timestamp()

stoch commented 7 years ago

@shamis @c-bik We should not use os:timestamp anywhere in our code. Where is this used now?

shamis commented 7 years ago

@stoch This is used here. It is only used in the test SUITE.

stoch commented 7 years ago

If unique timestamps are not required, os:timestamp are OK for debugging purposes. If imem is a dependency, imem_meta:time() is still preferred to represent time because it then is comparable to other logs of the system.

c-bik commented 7 years ago

@stoch imem isn't a dependency of erloci or erlocipool projects. For erlang applications/projects (which do not have imem), we have to rely on erlang native time APIs -- for all timestamp needs debugging or otherwise!

stoch commented 7 years ago

@c-bik Agreed, but we must pick the same time concept everywhere.

This means in our case: adapted system time (default VM start parameters); : timestamp() -> SystemTime = erlang:system_time(1000000), % or less resolution {SystemTime div 1000000, SystemTime rem 1000000}. % or whatever format you need