node/benchmark/function_call/binding.cc

20 lines
412 B
C++
Raw Normal View History

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