Skip to content

Commit

Permalink
fix: config package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
pjchender committed Feb 2, 2020
1 parent 7f2ad71 commit b4978ac
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 4 deletions.
1 change: 1 addition & 0 deletions .npmignore
@@ -0,0 +1 @@
src/
10 changes: 10 additions & 0 deletions .prettierrc
@@ -0,0 +1,10 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true,
"jsxBracketSameLine": false
}
11 changes: 11 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,11 @@
## [1.0.1](https://github.com/pjchender/react-use-opentok/compare/v1.0.1...v1.0.2) (2020-02-02)

### Fix

* config package.json

# 1.0.0 (2020-02-02)

### Features

* Init the project ([7f2ad716](https://github.com/pjchender/function-benchmarker/commit/7f2ad716a1a4ee5aa59557f7401954bf3b3bb163))
21 changes: 21 additions & 0 deletions LICENSE
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2020 PJCHENder

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
32 changes: 32 additions & 0 deletions README.md
@@ -0,0 +1,32 @@
# Function Benchmarker

A simple benchmark for testing function performance. Through the package, you can compare the cost time of different functions.

## Guide

Import '@pjchender/function-benchmarker` and make the function you want to test as a parameter. Function-benchmarker will return the cost time executing the function in milliseconds.

```js
const benchmarker = require('@pjchender/function-benchmarker');

function jsonStringify() {
JSON.stringify({
foo: 'bar',
});
}

const costTime = benchmarker(jsonStringify);
console.log('costTime', costTime);
```

## API

By default, function-benchmarker will run the function to test for 1,000,000 times and calculate the cost time (ms). You can pass the times for executing the function as the second parameter.

```js
const costTime = benchmarker(functionToTest, [times]);
```

## LICENSE

MIT
29 changes: 25 additions & 4 deletions package.json
@@ -1,12 +1,33 @@
{
"name": "@pjchender/function-benchmarker",
"version": "1.0.0",
"description": "",
"description": "A simple benchmark for testing function performance",
"license": "MIT",
"author": "PJCHENder <pjchender@gmail.com> (https://pjchender.blogspot.com)",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
"engines": {
"node": ">=8",
"npm": ">=5"
},
"files": [
"dist"
],
"repository": {
"type": "git",
"url": "https://github.com/pjchender/function-benchmarker.git"
},
"homepage": "https://github.com/pjchender/function-benchmarker",
"bugs": {
"url": "https://github.com/pjchender/function-benchmarker/issues"
},
"keywords": [
"performance",
"benchmark",
"evaluation",
"speed",
"timer"
]
}

0 comments on commit b4978ac

Please sign in to comment.