0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 23:16:30 +01:00
nodejs/benchmark/function_call/binding.cc
2010-09-25 18:19:50 +02:00

20 lines
412 B
C++

#include <v8.h>
#include <node.h>
#include <time.h>
using namespace v8;
static int c = 0;
static Handle<Value> Hello(const Arguments& args) {
HandleScope scope;
//time_t tv = time(NULL);
return scope.Close(Integer::New(c++));
}
extern "C" void init (Handle<Object> target) {
HandleScope scope;
//target->Set(String::New("hello"), String::New("World"));
NODE_SET_METHOD(target, "hello", Hello);
}