ngx-export-tools-1.0: Extra tools for Nginx haskell module
Copyright(c) Alexey Radkov 2018-2022
LicenseBSD-style
Maintaineralexey.radkov@gmail.com
Stabilitystable
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

NgxExport.Tools.TimeInterval

Description

 
Synopsis

A simple implementation of time intervals

A simple implementation of time intervals supposed for describing low resolution timeouts.

Exported data and functions

data TimeInterval Source #

Time intervals.

Note that Unset is a zero time interval which is equal to 0 seconds, however it is expected to be used differently. In particular, to explicitly express an intention to unset the timeout.

Constructors

Hr Int

Hours

Min Int

Minutes

Sec Int

Seconds

HrMin Int Int

Hours and minutes

MinSec Int Int

Minutes and seconds

Unset

Zero time interval

Instances

Instances details
FromJSON TimeInterval Source # 
Instance details

Defined in NgxExport.Tools.TimeInterval

Generic TimeInterval Source # 
Instance details

Defined in NgxExport.Tools.TimeInterval

Associated Types

type Rep TimeInterval :: Type -> Type #

Read TimeInterval Source # 
Instance details

Defined in NgxExport.Tools.TimeInterval

Show TimeInterval Source # 
Instance details

Defined in NgxExport.Tools.TimeInterval

Eq TimeInterval Source # 
Instance details

Defined in NgxExport.Tools.TimeInterval

Ord TimeInterval Source # 
Instance details

Defined in NgxExport.Tools.TimeInterval

Lift TimeInterval Source # 
Instance details

Defined in NgxExport.Tools.TimeInterval

Methods

lift :: Quote m => TimeInterval -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => TimeInterval -> Code m TimeInterval #

type Rep TimeInterval Source # 
Instance details

Defined in NgxExport.Tools.TimeInterval

toSec :: TimeInterval -> Int Source #

Converts a time interval into seconds.

threadDelaySec :: Int -> IO () Source #

Delays the current thread by the specified number of seconds.