Launch Week Day 1: Socket for Jira Is Now Available.Learn More
Socket
Book a DemoSign in
Socket

cpptime

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cpptime

An example C++ module for node.js that exports several synchronous time functions

latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
1
-50%
Maintainers
1
Weekly downloads
 
Created
Source

Oops!!! I forgot about Date() object in JavaScript. So this module is quite useless now. :)

This is a node.js module, writen in C++, that implements some missing time functions, such as getting timeval struct and getting unix time.

It was written by Peteris Krumins (peter@catonmat.net). His blog is at http://www.catonmat.net -- good coders code, great reuse.

The module exports three functions:

* getUnixTime - returns seconds since 1970, Jan 1 (+/- timezone offset)
* getTimeval - returns timeval struct as object with .sec and .usec props
* getMilliseconds - returns milliseconds since 1970, Jan 1 (+/- tz offset)

See examples/ dir for working examples.

How to compile?

As usual,

node-waf configure build

The module will be called time.node. To use it, make sure it's in NODE_PATH.

Extra info

This library was written for my and SubStack's StackVM startup:

http://github.com/pkrumins/stackvm
http://github.com/substack/stackvm

Have fun with time!

Sincerely, Peteris Krumins http://www.catonmat.net

Keywords

time

FAQs

Package last updated on 01 Feb 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts