Merge pull request #3 from ijin/master

configurable intervals
Merge pull request #4 from ijin/master

change duration to be period*2
version up 1.1.0 => 1.1.1
ver.1.2.1
use the latest datapoint after sorting by timestamp