Created
October 11, 2016 23:48
-
-
Save frenchbread/7dbc6d46c7e2b77305d90ebbe662e644 to your computer and use it in GitHub Desktop.
Some code from emqttd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-spec get_timestamp() -> integer(). | |
get_timestamp() -> | |
{Mega, Sec, Micro} = os:timestamp(), | |
(Mega*1000000 + Sec)*1000 + round(Micro/1000). | |
tuple_to_string(Req) -> | |
Timestamp = get_timestamp(), | |
{_,[_,Method,Path|Rest]} = Req, | |
Bucket = [Timestamp,{Method,Path}], | |
lists:flatten(io_lib:format("~p", [Bucket])). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment