"this is ["sparta"]"
"this is sparta"
Example benchmark code (which also shows why this would be helpful, the SPAN macro)
/world
loop_checks = 0
#define BENCHTM(NAME, ITERS, CODE) \
do{ \
var/s = world.tick_usage ;\
for(var/j = 1 to 1000000) {\
for(var/i = 1 to (ITERS)) {\
CODE ;\
} ;\
} ;\
var/e = world.tick_usage ;\
world.log << "[NAME]: [(e-s) * world.tick_lag] ms" ;\
} while(0)
#define SPAN_WARNING(X) "<span class='warning'>[X]</span>"
/proc/build_text_native()
. = "<span class='warning'>meow</span>"
/proc/build_text_compiler()
. = SPAN_WARNING("meow")
/proc/build_why_no_optimize()
. = "<span class='warning'>["meow"]</span>"
/proc/main()
BENCHTM("native", 10, world << build_text_native())
BENCHTM("compiler", 10, world << build_text_compiler())
BENCHTM("the fuck", 10, world << build_why_no_optimize())
Benchmark results:
But, I suspect the reason you want this is so you can use the same macro with non-constant stuff, so I totally get that.
I've actually been looking into the problem and I suspect this might be something I could work into the beta series for 515.