Skip to content

Instantly share code, notes, and snippets.

@Tensibai
Tensibai / Benchmark SO
Created Dec 31, 2015
The code used for benchmarking
View Benchmark SO
library(stringr)
library(microbenchmark)
str<-c("3412123401234")
replength<-function(pat,s) {
length( gregexpr(pat,s)[[1]] )
}
repeats<-function(s) {
r<-sapply(