Skip to content

If you want to compute the same user's online time from server log, who comes from multiple clients, so you needed to remove duplicate parts.

Notifications You must be signed in to change notification settings

eoecn/cross_time_calculation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cross Time calculation

If you want to compute the same user's online time from server log, who comes from multiple clients, so you need to remove duplicate parts.

Installation

gem install cross_time_calculation

Usage

require 'time'
require 'cross_time_calculation'

@t1 = DateTime.parse("20130512").to_time
@t2 = @t1 + 33
@ctc = CrossTimeCalculation.new
@ctc.add @t1, @t2

@ctc.total_seconds # => 33

See more complicated example in unit test

About

If you want to compute the same user's online time from server log, who comes from multiple clients, so you needed to remove duplicate parts.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages