easy_utc_now
Version, currently 0.2.03 versions
- 1.0.0latestJul 19, 2024
- 0.2.0not indexedJul 19, 2024
- 0.1.0not indexedJul 19, 2024
github.com/ndudnicz/EasyUtcNow
Faster and easier way to get an utc timestamp than calling standard Time lib
Nothing has been indexed for 0.2.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
easy_utc_now:
github: ndudnicz/EasyUtcNow
version: ~> 0.2.0Then run:
shards installshard.yml
No shard.yml has been indexed for 0.2.0. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
A timestamp module
Faster and easier way to get an utc timestamp than calling standard Time lib
Installation :
Add this to your application's shard.yml:
dependencies:
easy_utc_now:
github: ndudnicz/EasyUtcNow
version: 1.0.0
Example :
require "easy_utc_now"
puts EasyUtcNow.now_utc_to_unix
API :
Static Methods Summary :
.now_utc_to_unix :
Int64
Returns the current utc epoch timestamp in second
.now_utc_to_unix_ms_f :
Float64
Returns the current utc epoch timestamp in msecond
.now_utc_to_unix_f :
Float64
Returns the current utc epoch timestamp in second as Float64
Benchmark :
$> crystal -v
Crystal 1.13.1 (2024-07-12)
LLVM: 18.1.8
Default target: aarch64-apple-darwin23.5.0
$> cd bench
$> crystal build --release bench.cr
$> ./bench
Time.utc.to_unix 71.93M ( 13.90ns) (± 1.53%) 0.0B/op 1.15× slower
EasyUtcNow.now_utc_to_unix 82.46M ( 12.13ns) (± 3.96%) 0.0B/op fastest
Time.utc.to_unix_ms 58.34M ( 17.14ns) (± 2.67%) 0.0B/op 1.41× slower
EasyUtcNow.now_utc_to_unix_ms 82.19M ( 12.17ns) (± 1.26%) 0.0B/op fastest
Time.utc.to_unix_f 72.33M ( 13.83ns) (± 1.05%) 0.0B/op 1.15× slower
EasyUtcNow.now_utc_to_unix_f 83.02M ( 12.05ns) (± 1.16%) 0.0B/op fastest
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.2.0- Tagged
- Jul 19, 2024
- Commit
ad887d39fbd4- Indexed
- not yet
Dependents
No indexed shard depends on this one yet.
Repository
github.com/ndudnicz/EasyUtcNow
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 15, 2026
- Synced
- Aug 14, 2026
- Versions
- 3