Comments (4)
I tried in server code
TypeError: perfy.start is not a function
from perfy.
I don't know how you transpile your code but perfy
is a ES5 package (uses module.export
). So it's important how you bundle your project if you're using import
.
See this test using babel. This runs the following command to transpile:
npx babel index.js --out-file index-compiled.js --sourceType module --presets=@babel/preset-env
And below works as expected:
import perfy from 'perfy'; // works
// import * as perfy from 'perfy'; // also works
// const perfy = require('perfy'); // also works
perfy.start('test1');
setTimeout(() => {
const result = perfy.end('test1');
console.log(result);
}, 1000);
from perfy.
By the way, title of this issue is TypeError: process.hrtime is not a function
.
Are you trying to use perfy
in a browser environment? If so you can't. perfy is a lib for Node.js. It uses process
object which is only available in Node.js (i.e. server side).
from perfy.
Thanks for your reply.
Now work fine on Server Side
from perfy.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from perfy.