GitXplorerGitXplorer
u

gohumantime

public
4 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
173b8832d5d2ff5aa7879914c949d635b11779f8

fix readme and docs

uurjitbhatia committed 9 years ago
Unverified
89aaa8caf0cf3cab05baf21585788c15526e8459

handle float units

uurjitbhatia committed 9 years ago
Unverified
f6482e81fc81bce7aef399cf2c119713fb5478d0

Update README.md

uurjitbhatia committed 9 years ago
Unverified
a9a46a03b2020e126f6b090d57dc8fb2b5e6c991

Update README.md

uurjitbhatia committed 9 years ago
Unverified
82174ff631d399dfb1f5ceb06d432dca5bcff020

Adding test suite

uurjitbhatia committed 9 years ago
Unverified
2c82cd2d2bd59161f439613d80a1dc38a8cae725

fix project structure

uurjitbhatia committed 9 years ago

README

The README file for this repository.

gohumantime

A human readable time translator in golang

GoDoc

Motivation

Use a simple human readable string representation of time Inspired by: https://github.com/rschmukler/human-interval

Usage:

import "github.com/urjitbhatia/gohumantime"
//...
millis, err := gohumantime.ToMilliseconds("1 day and 14 hours")

millis, err := gohumantime.ToMilliseconds("9981234314")
// If string is numeric, unit is assumed to be Milliseconds and a simple atoi conversion is returned.
//...

Benchmarks

  //3000 samples of ToMilliseconds("4 seconds, 2 minutes 1 hour and 3 days and 10weeks, 1 month and 1 year"):

  Ran 3000 samples:
  runtime:
    Fastest Time: 0.000s
    Slowest Time: 0.001s
    Average Time: 0.000s ± 0.000s